CIRCNetwork.on433 Member

nickname in use

Syntax

object.on433(e);

Arguments

ArgumentSummary
e

Returns

Remarks

See Also

Source Code

function my_433 (e)
{
var nick = toUnicode(e.params[2], this);
if ("pendingReclaimCheck" in this)
{
delete this.pendingReclaimCheck;
return;
}
if (this.state == NET_CONNECTING)
{
// Force a number, thanks.
var nickIndex = 1 * arrayIndexOf(this.prefs["nicknameList"], nick);
var newnick = null;
dd("433: failed with " + nick + " (" + nickIndex + ")");
var tryList = true;
if ((("_firstNick" in this) && (this._firstNick == -1)) ||
(this.prefs["nicknameList"].length == 0) ||
((nickIndex != -1) && (this.prefs["nicknameList"].length < 2)))
{
tryList = false;
}
if (tryList)
{
nickIndex = (nickIndex + 1) % this.prefs["nicknameList"].length;
if (("_firstNick" in this) && (this._firstNick == nickIndex))
{
// We're back where we started. Give up with this method.
this._firstNick = -1;
tryList = false;
}
}
if (tryList)
{
newnick = this.prefs["nicknameList"][nickIndex];
dd(" trying " + newnick + " (" + nickIndex + ")");
// Save first index we've tried.
if (!("_firstNick" in this))
this._firstNick = nickIndex;
}
else if (this.NICK_RETRIES > 0)
{
newnick = this.INITIAL_NICK + "_";
this.NICK_RETRIES--;
dd(" trying " + newnick);
}
if (newnick)
{
this.INITIAL_NICK = newnick;
this.display(getMsg(MSG_RETRY_NICK, [nick, newnick]), "433");
this.primServ.changeNick(newnick);
}
else
{
this.display(getMsg(MSG_NICK_IN_USE, nick), "433");
}
}
else
{
this.display(getMsg(MSG_NICK_IN_USE, nick), "433");
}
}