CIRCServer.onRawData Member

onRawData begins shaping the event by parsing the IRC message at it's simplest level. After onRawData, the event will have the following properties: name value

Syntax

object.onRawData(e);

Arguments

ArgumentSummary
e

Returns

Remarks

set............"server"
type..........."parsedata"
destMethod....."onParsedData"
destObject.....server (this)
server.........server (this)
connection.....CBSConnection (this.connection)
source.........the <prefix> of the message (if it exists)
user...........user object initialized with data from the message <prefix> params.........array containing the parameters of the message code...........the first parameter (most messages have this)

See Section 2.3.1 of RFC 1459 for details on <prefix>, <middle> and <trailing> tokens.

See Also

Source Code

function serv_onRawData(e)
{
var ary;
var l = e.data;
if (l.length == 0)
{
dd ("empty line on onRawData?");
return false;
}
if (l[0] == ":")
{
// Must split only on REAL spaces here, not just any old whitespace.
ary = l.match(/:([^ ]+) +(.*)/);
e.source = ary[1];
l = ary[2];
ary = e.source.match(/([^ ]+)!([^ ]+)@(.*)/);
if (ary)
{
e.user = new CIRCUser(this, null, ary[1], ary[2], ary[3]);
}
else
{
ary = e.source.match(/([^ ]+)@(.*)/);
if (ary)
{
e.user = new CIRCUser(this, null, ary[1], null, ary[2]);
}
else
{
ary = e.source.match(/([^ ]+)!(.*)/);
if (ary)
e.user = new CIRCUser(this, null, ary[1], ary[2], null);
}
}
}
e.ignored = false;
if (("user" in e) && e.user && ("ignoreList" in this.parent))
{
// Assumption: if "ignoreList" is in this.parent, we assume that:
// a) it's an array.
// b) ignoreMaskCache also exists, and
// c) it's an array too.
if (!(e.source in this.parent.ignoreMaskCache))
{
for (var m in this.parent.ignoreList)
{
if (hostmaskMatches(e.user, this.parent.ignoreList[m]))
{
e.ignored = true;
break;
}
}
/* Save this exact source in the cache, with results of tests. */
this.parent.ignoreMaskCache[e.source] = e.ignored;
}
else
{
e.ignored = this.parent.ignoreMaskCache[e.source];
}
}
e.server = this;
var sep = l.indexOf(" :");
if (sep != -1) /* <trailing> param, if there is one */
{
var trail = l.substr (sep + 2, l.length);
e.params = l.substr(0, sep).split(/ +/);
e.params[e.params.length] = trail;
}
else
{
e.params = l.split(/ +/);
}
e.decodeParam = decodeParam;
e.code = e.params[0].toUpperCase();
// Ignore all Privmsg and Notice messages here.
if (e.ignored && ((e.code == "PRIVMSG") || (e.code == "NOTICE")))
return true;
e.type = "parseddata";
e.destObject = this;
e.destMethod = "onParsedData";
return true;
}