Make it possible to join an IRC chan

This commit is contained in:
Florian Quèze 2007-11-05 04:13:39 +01:00
Родитель 309f01ae63
Коммит 73b5b0f3f9
1 изменённых файлов: 17 добавлений и 1 удалений

Просмотреть файл

@ -76,7 +76,23 @@ var addBuddy = {
create: function ab_create() { create: function ab_create() {
var account = this.pcs.getAccountById(this.getValue("accountlist")); var account = this.pcs.getAccountById(this.getValue("accountlist"));
var tag = this.pcs.getTagById(this.getValue("taglist")); var tag = this.pcs.getTagById(this.getValue("taglist"));
this.pcs.addBuddy(account, tag, this.getValue("name")); var name = this.getValue("name")
// For now this will allow to join an IRC chan. It should be removed later
if (name[0] == "#" && account.protocol.id == "prpl-irc") {
var conv = account.joinChat(name);
if (!conv)
return;
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var convWindow = wm.getMostRecentWindow("Messenger:convs");
if (convWindow) {
convWindow.msgObserver.focusConv(conv);
convWindow.focus();
}
}
else
this.pcs.addBuddy(account, tag, name);
}, },
getAccounts: function ab_getAccounts() { getAccounts: function ab_getAccounts() {