checking in irc library updates described in 74164

chatzilla only, r=ssieb
This commit is contained in:
rginda%netscape.com 2001-04-15 00:04:32 +00:00
Родитель 6d18b94582
Коммит 00781c8cbf
4 изменённых файлов: 67 добавлений и 7 удалений

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

@ -80,8 +80,8 @@ function http_poll (e)
if (this.duration < this.GET_TIMEOUT)
try
{
line = this.connection.readData (50);
need_more = true;
line = this.connection.readData (50);
need_more = true;
}
catch (ex)
{

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

@ -21,13 +21,16 @@
* Robert Ginda, rginda@ndcico.com, original author
*/
var debugData = {lastEventType: "", lastEventData: ""};
/*
* Hook used to trace events.
*/
function event_tracer (e)
{
var name="", data="";
var name="";
var data="";
switch (e.set)
{
case "server":
@ -35,8 +38,19 @@ function event_tracer (e)
if (e.type == "rawdata")
data = "'" + e.data + "'";
if (e.type == "senddata")
data = "'" + e.destObject.sendQueue[0].replace ("\n", "\\n")
{
var nextLine =
e.destObject.sendQueue[e.destObject.sendQueue.length - 1];
data = "'" + nextLine.replace ("\n", "\\n")
+ "' (may retry a few times)";
if (debugData.lastEventType == "senddata" &&
debugData.lastEventData == data)
{
/* don't keep printing this event */
return;
}
}
break;
case "network":
@ -86,6 +100,9 @@ function event_tracer (e)
dd (str);
debugData.lastEventType = e.type;
debugData.lastEventData = data;
return true;
}

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

@ -270,7 +270,7 @@ function CIRCServer (parent, connection)
CIRCServer.prototype.MAX_LINES_PER_SEND = 5;
CIRCServer.prototype.MS_BETWEEN_SENDS = 1500;
CIRCServer.prototype.READ_TIMEOUT = 2000;
CIRCServer.prototype.READ_TIMEOUT = 100;
CIRCServer.prototype.TOO_MANY_LINES_MSG = "\01ACTION has said too much\01";
CIRCServer.prototype.VERSION_RPLY = "JS-IRC Library v0.01, " +
"Copyright (C) 1999 Robert Ginda; rginda@ndcico.com";
@ -768,6 +768,37 @@ function serv_332 (e)
}
/* whois name */
CIRCServer.prototype.on311 =
function serv_311 (e)
{
e.user = new CIRCUser (this, e.params[2], e.params[3], e.params[4]);
e.destObject = this.parent;
e.set = "network";
}
/* whois server */
CIRCServer.prototype.on312 =
function serv_312 (e)
{
e.user = new CIRCUser (this, e.params[2]);
e.user.connectionHost = e.params[3];
e.destObject = this.parent;
e.set = "network";
}
/* whois idle time */
CIRCServer.prototype.on317 =
function serv_317 (e)
{
e.user = new CIRCUser (this, e.params[2]);
e.user.idleSeconds = e.params[3];
e.destObject = this.parent;
e.set = "network";
}
/* topic information */
CIRCServer.prototype.on333 =
function serv_333 (e)
@ -1334,6 +1365,15 @@ function serv_ctcp (e)
}
CIRCServer.prototype.onCTCPAction =
function serv_cact (e)
{
e.destObject = e.replyTo;
e.set = (e.replyTo == e.user) ? "user" : "channel";
}
CIRCServer.prototype.onCTCPVersion =
function serv_cver (e)
{

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

@ -124,7 +124,10 @@ function dumpObjectTree (o, recurse, compress, level)
if (sfunc[2] == " [native code]")
sfunc = "[native code]";
else
sfunc = sfunc.length + " lines";
if (sfunc.length == 1)
sfunc = String(sfunc);
else
sfunc = sfunc.length + " lines";
s += pfx + tee + i + " (function) " + sfunc + "\n";
break;