Merge pull request #601 from torhve/read-improvements
Hotlist/Read/Unread improvements
This commit is contained in:
commit
03ed21f203
3 changed files with 11 additions and 3 deletions
|
@ -270,6 +270,8 @@ weechat.factory('connection',
|
||||||
if (parseInt(models.version.charAt(0)) >= 1) {
|
if (parseInt(models.version.charAt(0)) >= 1) {
|
||||||
// WeeChat >= 1 supports clearing hotlist with this command
|
// WeeChat >= 1 supports clearing hotlist with this command
|
||||||
sendMessage('/buffer set hotlist -1');
|
sendMessage('/buffer set hotlist -1');
|
||||||
|
// Also move read marker
|
||||||
|
sendMessage('/input set_unread_current_buffer');
|
||||||
} else {
|
} else {
|
||||||
// If user wants to sync hotlist with weechat
|
// If user wants to sync hotlist with weechat
|
||||||
// we will send a /buffer bufferName command every time
|
// we will send a /buffer bufferName command every time
|
||||||
|
|
|
@ -445,7 +445,11 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
||||||
|
|
||||||
// Clear the hotlist for this buffer, because presumable you have read
|
// Clear the hotlist for this buffer, because presumable you have read
|
||||||
// the messages in this buffer before you switched to the new one
|
// the messages in this buffer before you switched to the new one
|
||||||
|
// this is only needed with new type of clearing since in the old
|
||||||
|
// way WeeChat itself takes care of that part
|
||||||
|
if (parseInt(models.version.charAt(0)) >= 1) {
|
||||||
connection.sendHotlistClear();
|
connection.sendHotlistClear();
|
||||||
|
}
|
||||||
|
|
||||||
return models.setActiveBuffer(bufferId, key);
|
return models.setActiveBuffer(bufferId, key);
|
||||||
};
|
};
|
||||||
|
|
|
@ -104,8 +104,10 @@ weechat.directive('inputBar', function() {
|
||||||
$scope.command = '';
|
$scope.command = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Presumable we are reading the messages if we are sending.
|
// New style clearing requires this, old does not
|
||||||
|
if (parseInt(models.version.charAt(0)) >= 1) {
|
||||||
connection.sendHotlistClear();
|
connection.sendHotlistClear();
|
||||||
|
}
|
||||||
|
|
||||||
$scope.getInputNode().focus();
|
$scope.getInputNode().focus();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue