CIRCNetwork.on001 Member

Welcome!

Syntax

object.on001(e);

Arguments

ArgumentSummary
e

Returns

Remarks

See Also

Source Code

function my_showtonet (e)
{
var p = (3 in e.params) ? e.params[2] + " " : "";
var str = "";
switch (e.code)
{
case "004":
case "005":
str = e.params.slice(3).join(" ");
break;
case "001":
// Code moved to lower down to speed this bit up. :)
var c, u;
// If we've switched servers, *first* we must rehome our objects.
if (this.lastServer && (this.lastServer != this.primServ))
{
for (c in this.lastServer.channels)
this.lastServer.channels[c].rehome(this.primServ);
for (u in this.lastServer.users)
this.lastServer.users[u].rehome(this.primServ);
// 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]);
// 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);
// Figure out what nick we *really* want:
if (this.prefs["away"] && this.prefs["awayNick"])
this.preferredNick = this.prefs["awayNick"];
else
this.preferredNick = this.prefs["nickname"];
// Pretend this never happened.
delete this.pendingNickChange;
str = e.decodeParam(2);
break;
case "251": /* users */
this.doAutoPerform();
this.isIdleAway = client.isIdleAway;
if (this.prefs["away"])
this.dispatch("away", { reason: this.prefs["away"] });
if (this.lastServer)
{
// Re-join channels from previous connection.
for (c in this.primServ.channels)
{
var chan = this.primServ.channels[c];
if (chan.joined)
chan.join(chan.mode.key);
}
}
this.lastServer = this.primServ;
if ("pendingURLs" in this)
{
var target = this.pendingURLs.pop();
while (target)
{
gotoIRCURL(target.url, target.e);
target = this.pendingURLs.pop();
}
delete this.pendingURLs;
}
// Do this after the JOINs, so they are quicker.
// This is not time-critical code.
if (jsenv.HAS_SERVER_SOCKETS && client.prefs["dcc.enabled"] &&
this.prefs["dcc.useServerIP"])
{
var delayFn = function(t) {
// This is the quickest way to get out host/IP.
t.pendingUserhostReply = true;
t.primServ.sendData("USERHOST " +
t.primServ.me.encodedName + "\n");
};
setTimeout(delayFn, 1000 * Math.random(), this);
}
// Had some collision during connect.
if (this.primServ.me.unicodeName != this.preferredNick)
{
this.reclaimLeft = this.RECLAIM_TIMEOUT;
this.reclaimName();
}
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 */
case "422": /* no MOTD */
this.busy = false;
updateProgress();
/* Some servers (wrongly) dont send 251, so try
auto-perform after the MOTD as well */
this.doAutoPerform();
/* no break */
case "372":
case "375":
case "376":
if (this.IGNORE_MOTD)
return;
/* no break */
default:
str = e.decodeParam(e.params.length - 1);
break;
}
this.displayHere(p + str, e.code.toUpperCase());
}