CIRCServer.onJoin Member

Syntax

object.onJoin(e);

Arguments

ArgumentSummary
e

Returns

Remarks

See Also

Source Code

function serv_join(e)
{
e.channel = new CIRCChannel(this, null, e.params[1]);
// Passing undefined here because CIRCChanUser doesn't like "null"
e.user = new CIRCChanUser(e.channel, e.user.unicodeName, null,
undefined, true);
if (userIsMe(e.user))
{
var delayFn1 = function(t) {
if (!e.channel.active)
return;
// Give us the channel mode!
e.server.sendData("MODE " + e.channel.encodedName + "\n");
};
// Between 1s - 3s.
setTimeout(delayFn1, 1000 + 2000 * Math.random(), this);
var delayFn2 = function(t) {
if (!e.channel.active)
return;
// Get a full list of bans and exceptions, if supported.
if (arrayContains(t.channelModes.a, "b"))
{
e.server.sendData("MODE " + e.channel.encodedName + " +b\n");
e.channel.pendingBanList = true;
}
if (arrayContains(t.channelModes.a, "e"))
{
e.server.sendData("MODE " + e.channel.encodedName + " +e\n");
e.channel.pendingExceptList = true;
}
};
// Between 10s - 20s.
setTimeout(delayFn2, 10000 + 10000 * Math.random(), this);
/* Clean up the topic, since servers don't always send RPL_NOTOPIC
* (no topic set) when joining a channel without a topic. In fact,
* the RFC even fails to mention sending a RPL_NOTOPIC after a join!
*/
e.channel.topic = "";
e.channel.topicBy = null;
e.channel.topicDate = null;
// And we're in!
e.channel.active = true;
e.channel.joined = true;
}
e.destObject = e.channel;
e.set = "channel";
return true;
}