Store WeeChat version is an array of numbers
This commit is contained in:
parent
5df0ce21a2
commit
8c965e0b90
3 changed files with 4 additions and 3 deletions
|
@ -267,7 +267,7 @@ weechat.factory('connection',
|
||||||
};
|
};
|
||||||
|
|
||||||
var sendHotlistClear = function() {
|
var sendHotlistClear = function() {
|
||||||
if (parseInt(models.version.charAt(0)) >= 1) {
|
if (models.version[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
|
// Also move read marker
|
||||||
|
|
|
@ -447,7 +447,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
||||||
// 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
|
// this is only needed with new type of clearing since in the old
|
||||||
// way WeeChat itself takes care of that part
|
// way WeeChat itself takes care of that part
|
||||||
if (parseInt(models.version.charAt(0)) >= 1) {
|
if (models.version[0] >= 1) {
|
||||||
connection.sendHotlistClear();
|
connection.sendHotlistClear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,8 @@ weechat.factory('handlers', ['$rootScope', '$log', 'models', 'plugins', 'notific
|
||||||
var content = message.objects[0].content;
|
var content = message.objects[0].content;
|
||||||
var version = content.value;
|
var version = content.value;
|
||||||
// Store the WeeChat version in models
|
// Store the WeeChat version in models
|
||||||
models.version = version;
|
// this eats things like 1.3-dev -> [1,3]
|
||||||
|
models.version = version.split(".").map(function(c) { return parseInt(c); });
|
||||||
};
|
};
|
||||||
|
|
||||||
var handleBufferClosing = function(message) {
|
var handleBufferClosing = function(message) {
|
||||||
|
|
Loading…
Reference in a new issue