summaryrefslogtreecommitdiff
path: root/src/fe-common/irc/dcc
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-05-26 17:39:35 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-05-26 17:39:35 +0000
commit137aaeb4997295128a66d1ced6ff71bf12919e57 (patch)
treebb2a0ee88f31af70de33d008e4f30db841f22666 /src/fe-common/irc/dcc
parenteddc3d90c6f1defcdaec9311f22aaebe56ff0ada (diff)
downloadirssi-137aaeb4997295128a66d1ced6ff71bf12919e57.zip
"/MSG *" works now properly with dcc chat queries.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2826 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/irc/dcc')
-rw-r--r--src/fe-common/irc/dcc/fe-dcc-chat.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/fe-common/irc/dcc/fe-dcc-chat.c b/src/fe-common/irc/dcc/fe-dcc-chat.c
index 74d0d70b..3095fcfd 100644
--- a/src/fe-common/irc/dcc/fe-dcc-chat.c
+++ b/src/fe-common/irc/dcc/fe-dcc-chat.c
@@ -226,7 +226,7 @@ static void sig_dcc_list_print(CHAT_DCC_REC *dcc)
dcc->id, "CHAT");
}
-static void cmd_msg(const char *data)
+static void cmd_msg(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
{
CHAT_DCC_REC *dcc;
GHashTable *optlist;
@@ -240,18 +240,22 @@ static void cmd_msg(const char *data)
&optlist, &target, &text))
return;
- if (*target == '=') {
- /* handle only DCC messages */
+ /* handle only DCC messages */
+ if (strcmp(target, "*") == 0)
+ dcc = item_get_dcc(item);
+ else if (*target == '=')
dcc = dcc_chat_find_id(target+1);
- if (dcc == NULL || dcc->sendbuf == NULL) {
- printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
- IRCTXT_DCC_CHAT_NOT_FOUND, target+1);
- } else {
- if (query_find(NULL, target) == NULL)
- completion_last_message_add(target);
-
- signal_emit("message dcc own", 2, dcc, text);
- }
+ else
+ dcc = NULL;
+
+ if (dcc == NULL && *target == '=') {
+ printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
+ IRCTXT_DCC_CHAT_NOT_FOUND, target+1);
+ } else if (dcc != NULL) {
+ if (query_find(NULL, target) == NULL)
+ completion_last_message_add(target);
+
+ signal_emit("message dcc own", 2, dcc, text);
}
cmd_params_free(free_arg);