|
|
|
@ -452,7 +452,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', |
|
|
|
|
// 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) { |
|
|
|
|
if (models.version[0] >= 1) { |
|
|
|
|
connection.sendHotlistClear(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -464,9 +464,17 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', |
|
|
|
|
fullName = fullName.substring(0, fullName.lastIndexOf('.') + 1) + bufferName; // substitute the last part
|
|
|
|
|
|
|
|
|
|
if (!$scope.setActiveBuffer(fullName, 'fullName')) { |
|
|
|
|
var command = 'join'; |
|
|
|
|
// WeeChat 0.4.0+ supports /join -noswitch
|
|
|
|
|
// As Glowing Bear requires 0.4.2+, we don't need to check the version
|
|
|
|
|
var command = 'join -noswitch'; |
|
|
|
|
|
|
|
|
|
// Check if it's a query and we need to use /query instead
|
|
|
|
|
if (['#', '&', '+', '!'].indexOf(bufferName.charAt(0)) < 0) { // these are the characters a channel name can start with (RFC 2813-2813)
|
|
|
|
|
command = 'query'; |
|
|
|
|
// WeeChat 1.2+ supports /query -noswitch. See also #577 (different context)
|
|
|
|
|
if ((models.version[0] == 1 && models.version[1] >= 2) || models.version[1] > 1) { |
|
|
|
|
command += " -noswitch"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
connection.sendMessage('/' + command + ' ' + bufferName); |
|
|
|
|
} |
|
|
|
|