1
0
mirror of https://github.com/irssi/irssi.git synced 2024-07-07 02:54:19 -04:00

added "dcc request send" signal - irssi now prints "DCC CHAT/SEND request

sent to nick".


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1472 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-05-11 12:55:18 +00:00 committed by cras
parent cb28685574
commit f3f8eb620a
6 changed files with 17 additions and 0 deletions

View File

@ -184,6 +184,7 @@ dcc*.c:
"dcc rejecting", DCC_REC
"dcc closed", DCC_REC
"dcc request", DCC_REC, char *sendaddr
"dcc request send", DCC_REC
"dcc chat message", DCC_REC, char *msg
"dcc transfer update", DCC_REC
"dcc get receive", DCC_REC

View File

@ -66,6 +66,14 @@ static void dcc_rejected(DCC_REC *dcc)
dcc_type2str(dcc->type), dcc->nick, dcc->arg);
}
static void dcc_request_send(DCC_REC *dcc)
{
g_return_if_fail(dcc != NULL);
printformat(dcc->server, NULL, MSGLEVEL_DCC, IRCTXT_DCC_REQUEST_SEND,
dcc_type2str(dcc->type), dcc->nick, dcc->arg);
}
static void dcc_error_connect(DCC_REC *dcc)
{
g_return_if_fail(dcc != NULL);
@ -124,6 +132,7 @@ void fe_irc_dcc_init(void)
signal_add("dcc request", (SIGNAL_FUNC) dcc_request);
signal_add("dcc rejected", (SIGNAL_FUNC) dcc_rejected);
signal_add("dcc request send", (SIGNAL_FUNC) dcc_request_send);
signal_add("dcc error connect", (SIGNAL_FUNC) dcc_error_connect);
signal_add("dcc error unknown type", (SIGNAL_FUNC) dcc_error_unknown_type);
command_bind("dcc", NULL, (SIGNAL_FUNC) cmd_dcc);
@ -142,6 +151,7 @@ void fe_irc_dcc_deinit(void)
signal_remove("dcc request", (SIGNAL_FUNC) dcc_request);
signal_remove("dcc rejected", (SIGNAL_FUNC) dcc_rejected);
signal_remove("dcc request send", (SIGNAL_FUNC) dcc_request_send);
signal_remove("dcc error connect", (SIGNAL_FUNC) dcc_error_connect);
signal_remove("dcc error unknown type", (SIGNAL_FUNC) dcc_error_unknown_type);
command_unbind("dcc", (SIGNAL_FUNC) cmd_dcc);

View File

@ -60,6 +60,7 @@ FORMAT_REC fecommon_irc_dcc_formats[] = {
{ "dcc_connect_error", "{dcc DCC can't connect to {hilight $0} port {hilight $1}}", 2, { 0, 1 } },
{ "dcc_cant_create", "{dcc DCC can't create file {dccfile $0}}", 1, { 0 } },
{ "dcc_rejected", "{dcc DCC $0 was rejected by {nick $1} [{hilight $2}]}", 3, { 0, 0, 0 } },
{ "dcc_request_send", "{dcc DCC $0 request sent to {nick $1}: $2", 3, { 0, 0, 0 } },
{ "dcc_close", "{dcc DCC $0 close for {nick $1} [{hilight $2}]}", 3, { 0, 0, 0 } },
{ "dcc_lowport", "{dcc Warning: Port sent with DCC request is a lowport ({hilight $0, $1}) - this isn't normal. It is possible the address/port is faked (or maybe someone is just trying to bypass firewall)}", 2, { 1, 0 } },
{ "dcc_list_header", "{dcc DCC connections}", 0 },

View File

@ -38,6 +38,7 @@ enum {
IRCTXT_DCC_CONNECT_ERROR,
IRCTXT_DCC_CANT_CREATE,
IRCTXT_DCC_REJECTED,
IRCTXT_DCC_REQUEST_SEND,
IRCTXT_DCC_CLOSE,
IRCTXT_DCC_LOWPORT,
IRCTXT_DCC_LIST_HEADER,

View File

@ -439,6 +439,8 @@ static void cmd_dcc_chat(const char *data, IRC_SERVER_REC *server)
(GInputFunction) dcc_chat_listen, dcc);
/* send the chat request */
signal_emit("dcc request send", 1, dcc);
dcc_ip2str(&own_ip, host);
irc_send_cmdv(server, "PRIVMSG %s :\001DCC CHAT CHAT %s %d\001",
nick, host, port);

View File

@ -232,6 +232,8 @@ static void cmd_dcc_send(const char *data, IRC_SERVER_REC *server,
(GInputFunction) dcc_send_connected, dcc);
/* send DCC request */
signal_emit("dcc request send", 1, dcc);
dcc_ip2str(&own_ip, host);
str = g_strdup_printf(dcc->file_quoted ?
"DCC SEND \"%s\" %s %d %lu" :