CIRCNetwork.on303 Member

ISON (aka notify) reply

Syntax

object.on303(e);

Arguments

ArgumentSummary
e

Returns

Remarks

See Also

Source Code

function my_303 (e)
{
function lower(text)
{
return e.server.toLowerCase(text);
};
var onList = new Array();
// split() gives an array of one item ("") when splitting "", which we
// don't want, so only do the split if there's something to split.
if (e.params[2])
onList = stringTrim(e.server.toLowerCase(e.params[2])).split(/\s+/);
var offList = new Array();
var newArrivals = new Array();
var newDepartures = new Array();
var o = getObjectDetails(client.currentObject);
var displayTab;
var i;
if ("network" in o && o.network == this && client.currentObject != this)
displayTab = client.currentObject;
for (i = 0; i < this.prefs["notifyList"].length; i++)
{
if (!arrayContains(onList, lower(this.prefs["notifyList"][i])))
/* user is not on */
offList.push(lower(this.prefs["notifyList"][i]));
}
if ("onList" in this)
{
for (i in onList)
if (!arrayContains(this.onList, onList[i]))
/* we didn't know this person was on */
newArrivals.push(onList[i]);
}
else
this.onList = newArrivals = onList;
if ("offList" in this)
{
for (i in offList)
if (!arrayContains(this.offList, offList[i]))
/* we didn't know this person was off */
newDepartures.push(offList[i]);
}
else
this.offList = newDepartures = offList;
if (newArrivals.length > 0)
{
this.displayHere (arraySpeak (newArrivals, "is", "are") +
" online.", "NOTIFY-ON");
if (displayTab)
displayTab.displayHere (arraySpeak (newArrivals, "is", "are") +
" online.", "NOTIFY-ON");
}
if (newDepartures.length > 0)
{
this.displayHere (arraySpeak (newDepartures, "is", "are") +
" offline.", "NOTIFY-OFF");
if (displayTab)
displayTab.displayHere (arraySpeak (newDepartures, "is", "are") +
" offline.", "NOTIFY-OFF");
}
this.onList = onList;
this.offList = offList;
}