CIRCChannel.onJoin Member

Syntax

object.onJoin(e);

Arguments

ArgumentSummary
e

Returns

Remarks

See Also

Source Code

function my_cjoin (e)
{
if (!("messages" in this))
this.displayHere(getMsg(MSG_CHANNEL_OPENED, this.unicodeName), MT_INFO);
if (userIsMe(e.user))
{
var params = [e.user.unicodeName, e.channel.unicodeName];
this.display(getMsg(MSG_YOU_JOINED, params), "JOIN",
e.server.me, this);
/* Tell the user that conference mode is on, lest they forget (if it
* subsequently turns itself off, they'll get a message anyway).
*/
if (this.prefs["conference.enabled"])
this.display(MSG_CONF_MODE_STAYON);
if (client.globalHistory)
client.globalHistory.addPage(this.getURL());
if ("joinTimer" in this)
{
clearTimeout(this.joinTimer);
delete this.joinTimer;
this.busy = false;
updateProgress();
}
/* !-channels are "safe" channels, and get a server-generated prefix.
* For this reason, creating the channel is delayed until this point.
*/
if (e.channel.unicodeName[0] == "!")
dispatch("set-current-view", { view: e.channel });
}
else
{
if (!this.prefs["conference.enabled"])
{
this.display(getMsg(MSG_SOMEONE_JOINED,
[e.user.unicodeName, e.user.name, e.user.host,
e.channel.unicodeName]),
"JOIN", e.user, this);
}
/* Only do this for non-me joins so us joining doesn't reset it (when
* we join the usercount is always 1). Also, do this after displaying
* the join message so we don't get cryptic effects such as a user
* joining causes *only* a "Conference mode enabled" message.
*/
this._updateConferenceMode();
}
/* We don't want to add ourself here, since the names reply we'll be
* getting right after the join will include us as well! (FIXME)
*/
if (!userIsMe(e.user))
{
this.addUsers([e.user]);
var entry = new UserEntry(e.user, this.userListShare);
this.userList.childData.appendChild(entry);
this.userList.childData.reSort();
}
this.updateHeader();
}