|
|
@ -666,6 +666,18 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', |
|
|
|
$scope.bufferlines = ab.lines; |
|
|
|
$scope.bufferlines = ab.lines; |
|
|
|
$scope.nicklist = ab.nicklist; |
|
|
|
$scope.nicklist = ab.nicklist; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Send a request for the nicklist if it hasn't been loaded yet
|
|
|
|
|
|
|
|
if (!ab.nicklistRequested()) { |
|
|
|
|
|
|
|
connection.requestNicklist(ab.fullName, function() { |
|
|
|
|
|
|
|
$scope.showNicklist = $scope.updateShowNicklist(); |
|
|
|
|
|
|
|
// Scroll after nicklist has been loaded, as it may break long lines
|
|
|
|
|
|
|
|
$rootScope.scrollWithBuffer(true); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// Check if we should show nicklist or not
|
|
|
|
|
|
|
|
$scope.showNicklist = $scope.updateShowNicklist(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (ab.requestedLines < $scope.lines) { |
|
|
|
if (ab.requestedLines < $scope.lines) { |
|
|
|
// buffer has not been loaded, but some lines may already be present if they arrived after we connected
|
|
|
|
// buffer has not been loaded, but some lines may already be present if they arrived after we connected
|
|
|
|
// try to determine how many lines to fetch
|
|
|
|
// try to determine how many lines to fetch
|
|
|
@ -679,18 +691,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', |
|
|
|
} |
|
|
|
} |
|
|
|
$rootScope.updateTitle(ab); |
|
|
|
$rootScope.updateTitle(ab); |
|
|
|
|
|
|
|
|
|
|
|
// Send a request for the nicklist if it hasn't been loaded yet
|
|
|
|
|
|
|
|
if (!ab.nicklistRequested()) { |
|
|
|
|
|
|
|
connection.requestNicklist(ab.fullName, function() { |
|
|
|
|
|
|
|
$scope.showNicklist = $scope.updateShowNicklist(); |
|
|
|
|
|
|
|
// Scroll after nicklist has been loaded, as it may break long lines
|
|
|
|
|
|
|
|
$rootScope.scrollWithBuffer(true); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// Check if we should show nicklist or not
|
|
|
|
|
|
|
|
$scope.showNicklist = $scope.updateShowNicklist(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$rootScope.scrollWithBuffer(true); |
|
|
|
$rootScope.scrollWithBuffer(true); |
|
|
|
|
|
|
|
|
|
|
|
// If user wants to sync hotlist with weechat
|
|
|
|
// If user wants to sync hotlist with weechat
|
|
|
@ -868,7 +868,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', |
|
|
|
// get last word
|
|
|
|
// get last word
|
|
|
|
var lastSpace = trimmedValue.lastIndexOf(' ') + 1; |
|
|
|
var lastSpace = trimmedValue.lastIndexOf(' ') + 1; |
|
|
|
var lastWord = trimmedValue.slice(lastSpace, trimmedValue.length - 1); |
|
|
|
var lastWord = trimmedValue.slice(lastSpace, trimmedValue.length - 1); |
|
|
|
var nicklist = models.getActiveBuffer().flatNicklist(); |
|
|
|
var nicklist = models.getActiveBuffer().getNicklistByTime(); |
|
|
|
// check against nicklist to see if it's a list of highlights
|
|
|
|
// check against nicklist to see if it's a list of highlights
|
|
|
|
if (nicklist.indexOf(lastWord) !== -1) { |
|
|
|
if (nicklist.indexOf(lastWord) !== -1) { |
|
|
|
// It's another highlight!
|
|
|
|
// It's another highlight!
|
|
|
@ -1230,12 +1230,12 @@ weechat.directive('inputBar', function() { |
|
|
|
// get current caret position
|
|
|
|
// get current caret position
|
|
|
|
var caretPos = inputNode.selectionStart; |
|
|
|
var caretPos = inputNode.selectionStart; |
|
|
|
|
|
|
|
|
|
|
|
// create flat array of nicks
|
|
|
|
// get current active buffer
|
|
|
|
var activeBuffer = models.getActiveBuffer(); |
|
|
|
var activeBuffer = models.getActiveBuffer(); |
|
|
|
|
|
|
|
|
|
|
|
// complete nick
|
|
|
|
// complete nick
|
|
|
|
var nickComp = IrcUtils.completeNick(inputText, caretPos, |
|
|
|
var nickComp = IrcUtils.completeNick(inputText, caretPos, |
|
|
|
$scope.iterCandidate, activeBuffer.flatNicklist(), ':'); |
|
|
|
$scope.iterCandidate, activeBuffer.getNicklistByTime(), ':'); |
|
|
|
|
|
|
|
|
|
|
|
// remember iteration candidate
|
|
|
|
// remember iteration candidate
|
|
|
|
$scope.iterCandidate = nickComp.iterCandidate; |
|
|
|
$scope.iterCandidate = nickComp.iterCandidate; |
|
|
|