Merge pull request #89 from lorenzhs/lastread
Initalise lastread marker to last read line when initially fetching messages from server
This commit is contained in:
commit
c14bec83fb
2 changed files with 5 additions and 1 deletions
|
@ -23,7 +23,7 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
var active = false
|
var active = false
|
||||||
var notification = 0
|
var notification = 0
|
||||||
var unread = 0
|
var unread = 0
|
||||||
var lastSeen = -2
|
var lastSeen = -1
|
||||||
var serverSortKey = fullName.replace(/^irc.server.(\w+)/, "irc.$1");
|
var serverSortKey = fullName.replace(/^irc.server.(\w+)/, "irc.$1");
|
||||||
|
|
||||||
var indent = function(predicate) {
|
var indent = function(predicate) {
|
||||||
|
|
|
@ -30,6 +30,10 @@ weechat.factory('handlers', ['$rootScope', 'models', 'plugins', function($rootSc
|
||||||
message = plugins.PluginManager.contentForMessage(message, $rootScope.visible);
|
message = plugins.PluginManager.contentForMessage(message, $rootScope.visible);
|
||||||
buffer.addLine(message);
|
buffer.addLine(message);
|
||||||
|
|
||||||
|
if (initial) {
|
||||||
|
buffer.lastSeen++;
|
||||||
|
}
|
||||||
|
|
||||||
if (buffer.active) {
|
if (buffer.active) {
|
||||||
$rootScope.scrollToBottom();
|
$rootScope.scrollToBottom();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue