mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Bug 331047 - Add support for NAMESX (multiple modes in /names response)
p=rdmsoft@rdmsoft.com (Robert Marshall) r=silver ChatZilla Only
This commit is contained in:
parent
0f594a9db2
commit
8a44ff9f8c
@ -1426,18 +1426,11 @@ function serv_001 (e)
|
||||
this.parent.INITIAL_UMODE + "\n");
|
||||
}
|
||||
|
||||
if (this.parent.INITIAL_CHANNEL)
|
||||
{
|
||||
this.parent.primChan = this.addChannel (this.parent.INITIAL_CHANNEL);
|
||||
this.parent.primChan.join();
|
||||
}
|
||||
|
||||
this.parent.users = this.users;
|
||||
e.destObject = this.parent;
|
||||
e.set = "network";
|
||||
}
|
||||
|
||||
|
||||
/* server features */
|
||||
CIRCServer.prototype.on005 =
|
||||
function serv_005 (e)
|
||||
@ -1562,6 +1555,26 @@ function serv_005 (e)
|
||||
return true;
|
||||
}
|
||||
|
||||
/* users */
|
||||
CIRCServer.prototype.on251 =
|
||||
function serv_251(e)
|
||||
{
|
||||
// 251 is the first message we get after 005, so it's now safe to do
|
||||
// things that might depend upon server features.
|
||||
|
||||
if (this.supports.namesx)
|
||||
this.sendData("PROTOCTL NAMESX\n");
|
||||
|
||||
if (this.parent.INITIAL_CHANNEL)
|
||||
{
|
||||
this.parent.primChan = this.addChannel(this.parent.INITIAL_CHANNEL);
|
||||
this.parent.primChan.join();
|
||||
}
|
||||
|
||||
e.destObject = this.parent;
|
||||
e.set = "network";
|
||||
}
|
||||
|
||||
/* user away message */
|
||||
CIRCServer.prototype.on301 =
|
||||
function serv_301(e)
|
||||
@ -1715,7 +1728,7 @@ function serv_315 (e)
|
||||
return true;
|
||||
}
|
||||
|
||||
/* name reply */
|
||||
/* names reply */
|
||||
CIRCServer.prototype.on353 =
|
||||
function serv_353 (e)
|
||||
{
|
||||
@ -1738,21 +1751,23 @@ function serv_353 (e)
|
||||
if (nick == "")
|
||||
break;
|
||||
|
||||
var found = false;
|
||||
for (var m in mList)
|
||||
var modes = new Array();
|
||||
do
|
||||
{
|
||||
if (nick[0] == mList[m].symbol)
|
||||
var found = false;
|
||||
for (var m in mList)
|
||||
{
|
||||
e.user = new CIRCChanUser(e.channel, null,
|
||||
nick.substr(1, nick.length),
|
||||
[ mList[m].mode ]);
|
||||
found = true;
|
||||
break;
|
||||
if (nick[0] == mList[m].symbol)
|
||||
{
|
||||
nick = nick.substr(1);
|
||||
modes.push(mList[m].mode);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
e.user = new CIRCChanUser(e.channel, null, nick, [ ]);
|
||||
} while (found && this.supports.namesx);
|
||||
|
||||
new CIRCChanUser(e.channel, null, nick, modes);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -1021,12 +1021,29 @@ function my_showtonet (e)
|
||||
// This makes sure we have the *right* me object.
|
||||
this.primServ.me.rehome(this.primServ);
|
||||
}
|
||||
|
||||
// Update the list of ignored users from the prefs:
|
||||
var ignoreAry = this.prefs["ignoreList"];
|
||||
for (var j = 0; j < ignoreAry.length; ++j)
|
||||
this.ignoreList[ignoreAry[j]] = getHostmaskParts(ignoreAry[j]);
|
||||
|
||||
// After rehoming it is now safe for the user's commands.
|
||||
// Update everything.
|
||||
// Welcome to history.
|
||||
if (client.globalHistory)
|
||||
client.globalHistory.addPage(this.getURL());
|
||||
updateTitle(this);
|
||||
this.updateHeader();
|
||||
client.updateHeader();
|
||||
updateSecurityIcon();
|
||||
updateStalkExpression(this);
|
||||
|
||||
client.ident.removeNetwork(this);
|
||||
|
||||
str = e.decodeParam(2);
|
||||
|
||||
break;
|
||||
|
||||
case "251": /* users */
|
||||
var cmdary = this.prefs["autoperform"];
|
||||
for (var i = 0; i < cmdary.length; ++i)
|
||||
{
|
||||
@ -1062,16 +1079,6 @@ function my_showtonet (e)
|
||||
delete this.pendingURLs;
|
||||
}
|
||||
|
||||
// Update everything.
|
||||
// Welcome to history.
|
||||
if (client.globalHistory)
|
||||
client.globalHistory.addPage(this.getURL());
|
||||
updateTitle(this);
|
||||
this.updateHeader();
|
||||
client.updateHeader();
|
||||
updateSecurityIcon();
|
||||
updateStalkExpression(this);
|
||||
|
||||
// Do this after the JOINs, so they are quicker.
|
||||
// This is not time-critical code.
|
||||
if (jsenv.HAS_SERVER_SOCKETS && client.prefs["dcc.enabled"] &&
|
||||
@ -1086,8 +1093,6 @@ function my_showtonet (e)
|
||||
setTimeout(delayFn, 1000 * Math.random(), this);
|
||||
}
|
||||
|
||||
client.ident.removeNetwork(this);
|
||||
|
||||
// Had some collision during connect.
|
||||
if (this.primServ.me.unicodeName != this.prefs["nickname"])
|
||||
{
|
||||
@ -1095,12 +1100,13 @@ function my_showtonet (e)
|
||||
this.reclaimName();
|
||||
}
|
||||
|
||||
str = e.decodeParam(2);
|
||||
if ("onLogin" in this)
|
||||
{
|
||||
ev = new CEvent("network", "login", this, "onLogin");
|
||||
client.eventPump.addEvent(ev);
|
||||
}
|
||||
|
||||
str = e.decodeParam(e.params.length - 1);
|
||||
break;
|
||||
|
||||
case "376": /* end of MOTD */
|
||||
@ -1122,7 +1128,6 @@ function my_showtonet (e)
|
||||
}
|
||||
|
||||
this.displayHere(p + str, e.code.toUpperCase());
|
||||
|
||||
}
|
||||
|
||||
CIRCNetwork.prototype.onUnknownCTCPReply =
|
||||
|
Loading…
Reference in New Issue
Block a user