CIRCServer.onCTCPClientinfo Member
Syntax
object.onCTCPClientinfo(e);
Arguments
Argument | Summary |
---|---|
e |
Returns
Remarks
See Also
Source Code
function serv_ccinfo (e)
{
var clientinfo = new Array();
if (e.CTCPData)
{
var cmdName = "onCTCP" + e.CTCPData[0].toUpperCase() +
e.CTCPData.substr (1, e.CTCPData.length).toLowerCase();
var helpName = cmdName.replace(/^onCTCP/, "CTCPHelp");
// Check we support the command.
if (cmdName in this)
{
// Do we have help for it?
if (helpName in this)
{
var msg;
if (typeof this[helpName] == "function")
msg = this[helpName]();
else
msg = this[helpName];
e.user.ctcp("CLIENTINFO", msg, "NOTICE");
}
else
{
e.user.ctcp("CLIENTINFO",
getMsg(MSG_ERR_NO_CTCP_HELP, e.CTCPData), "NOTICE");
}
}
else
{
e.user.ctcp("CLIENTINFO",
getMsg(MSG_ERR_NO_CTCP_CMD, e.CTCPData), "NOTICE");
}
return true;
}
for (var fname in this)
{
var ary = fname.match(/^onCTCP(.+)/);
if (ary && ary[1].search(/^Reply/) == -1)
clientinfo.push (ary[1].toUpperCase());
}
e.user.ctcp("CLIENTINFO", clientinfo.join(" "), "NOTICE");
return true;
}