CIRCUser.onDCCSend Member
Syntax
object.onDCCSend(e);
Arguments
Argument | Summary |
---|---|
e |
Returns
Remarks
See Also
Source Code
function my_dccsend(e)
{
if (!jsenv.HAS_SERVER_SOCKETS || !client.prefs["dcc.enabled"])
return;
var u = client.dcc.addUser(e.user, e.host);
var f = client.dcc.addFileTransfer(u, e.port, e.file, e.size);
var str = MSG_DCCFILE_GOT_REQUEST;
var cmds = getMsg(MSG_DCC_COMMAND_ACCEPT, "dcc-accept " + f.id) + " " +
getMsg(MSG_DCC_COMMAND_DECLINE, "dcc-decline " + f.id);
var allowList = this.parent.parent.prefs["dcc.autoAccept.list"];
for (var m = 0; m < allowList.length; ++m)
{
if (hostmaskMatches(e.user, getHostmaskParts(allowList[m]),
this.parent))
{
var acceptDelay = client.prefs["dcc.autoAccept.delay"];
if (acceptDelay == 0)
{
str = MSG_DCCFILE_ACCEPTING_NOW;
}
else
{
str = MSG_DCCFILE_ACCEPTING;
cmds = [(acceptDelay / 1000), cmds];
}
setTimeout(onDCCAutoAcceptTimeout, acceptDelay,
f, this.parent.parent.prefs["dcc.downloadsFolder"]);
break;
}
}
client.munger.getRule(".inline-buttons").enabled = true;
this.parent.parent.display(getMsg(str,[e.user.unicodeName,
e.host, e.port, e.file,
getSISize(e.size)].concat(cmds)),
"DCC-FILE");
client.munger.getRule(".inline-buttons").enabled = false;
// Pass the event over to the DCC File object.
e.set = "dcc-file";
e.destObject = f;
e.destMethod = "onGotRequest";
}