Fetch nicklist by buffer name, not pointer

An invalid pointer will crash WeeChat, while an invalid name will not. A pointer
becomes invalid e.g. if the buffer is closed by another client, g-b not updated,
and the buffer then selected in g-b.
This commit is contained in:
Lorenz Hübschle-Schneider 2014-03-08 21:30:14 +00:00
parent 730c7dab8d
commit dc0ce33bea

View file

@ -657,8 +657,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
// Send a request for the nicklist if it hasn't been loaded yet
if (!ab.nicklistRequested()) {
var bufferId = '0x' + ab.id; // WeeChat needs the 0x prefix
connection.requestNicklist(bufferId, function() {
connection.requestNicklist(ab.fullName, function() {
$scope.showNicklist = $scope.updateShowNicklist();
// Scroll after nicklist has been loaded, as it may break long lines
$rootScope.scrollWithBuffer(true);