CIRCDCCChat.onCTCP Member

Syntax

object.onCTCP(e);

Arguments

ArgumentSummary
e

Returns

Remarks

See Also

Source Code

function serv_ctcp(e)
{
// The \x0D? is a BIG HACK to make this work with X-Chat.
var ary = e.line.match(/^\x01([^ ]+) ?(.*)\x01\x0D?$/i);
if (ary == null)
return false;
e.CTCPData = ary[2] ? ary[2] : "";
e.CTCPCode = ary[1].toLowerCase();
if (e.CTCPCode.search(/^reply/i) == 0)
{
dd("dropping spoofed reply.");
return false;
}
e.CTCPCode = toUnicode(e.CTCPCode, e.replyTo);
e.CTCPData = toUnicode(e.CTCPData, e.replyTo);
e.type = "ctcp-" + e.CTCPCode;
e.destMethod = "onCTCP" + ary[1][0].toUpperCase() +
ary[1].substr(1, ary[1].length).toLowerCase();
if (typeof this[e.destMethod] != "function")
{
e.destObject = e.user;
e.set = "dcc-user";
if (typeof e.user[e.destMethod] != "function")
{
e.type = "unk-ctcp";
e.destMethod = "onUnknownCTCP";
}
}
else
{
e.destObject = this;
}
return true;
}