Bug 330990 - Send notices and privmsgs to the right channel even when using STATUSMSG prefixes on the target.

ChatZilla only.
r=samuel
This commit is contained in:
silver%warwickcompsoc.co.uk 2006-07-23 14:17:54 +00:00
Родитель 921ddb5c87
Коммит 2338f23a33
1 изменённых файлов: 44 добавлений и 18 удалений

Просмотреть файл

@ -2271,48 +2271,74 @@ function serv_invite(e)
CIRCServer.prototype.onNotice =
function serv_notice (e)
{
if (!("user" in e))
var targetName = e.params[1];
// Strip off one (and only one) user mode prefix.
for (var i = 0; i < this.userModes.length; i++)
{
if (targetName[0] == this.userModes[i].symbol)
{
targetName = targetName.substr(1);
break;
}
}
if (arrayIndexOf(this.channelTypes, targetName[0]) != -1)
{
e.channel = new CIRCChannel(this, null, targetName);
if ("user" in e)
e.user = new CIRCChanUser(e.channel, e.user.unicodeName);
e.replyTo = e.channel;
e.set = "channel";
}
else if (!("user" in e))
{
e.set = "network";
e.destObject = this.parent;
return true;
}
if (arrayIndexOf(this.channelTypes, e.params[1][0]) != -1)
else
{
e.channel = new CIRCChannel(this, null, e.params[1]);
e.user = new CIRCChanUser(e.channel, e.user.unicodeName);
e.replyTo = e.channel;
e.set = "channel";
e.set = "user";
e.replyTo = e.user; /* send replies to the user who sent the message */
}
else if (e.params[2].search (/\x01.*\x01/i) != -1)
if (e.params[2].search (/\x01.*\x01/i) != -1)
{
e.type = "ctcp-reply";
e.destMethod = "onCTCPReply";
e.set = "server";
e.destObject = this;
return true;
}
else
{
e.set = "user";
e.replyTo = e.user; /* send replys to the user who sent the message */
e.msg = e.decodeParam(2, e.replyTo);
e.destObject = e.replyTo;
}
e.msg = e.decodeParam(2, e.replyTo);
e.destObject = e.replyTo;
return true;
}
CIRCServer.prototype.onPrivmsg =
function serv_privmsg (e)
{
/* setting replyTo provides a standard place to find the target for */
/* replys associated with this event. */
if (arrayIndexOf(this.channelTypes, e.params[1][0]) != -1)
var targetName = e.params[1];
// Strip off one (and only one) user mode prefix.
for (var i = 0; i < this.userModes.length; i++)
{
e.channel = new CIRCChannel(this, null, e.params[1]);
if (targetName[0] == this.userModes[i].symbol)
{
targetName = targetName.substr(1);
break;
}
}
/* setting replyTo provides a standard place to find the target for */
/* replies associated with this event. */
if (arrayIndexOf(this.channelTypes, targetName[0]) != -1)
{
e.channel = new CIRCChannel(this, null, targetName);
e.user = new CIRCChanUser(e.channel, e.user.unicodeName);
e.replyTo = e.channel;
e.set = "channel";