1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-29 04:45:57 -04:00

"/MSG *" works now properly with dcc chat queries.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2826 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-05-26 17:39:35 +00:00 committed by cras
parent eddc3d90c6
commit 137aaeb499
2 changed files with 28 additions and 19 deletions

View File

@ -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);
else
dcc = NULL;
signal_emit("message dcc own", 2, dcc, text);
}
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);

View File

@ -173,7 +173,7 @@ CHAT_DCC_REC *item_get_dcc(WI_ITEM_REC *item)
}
/* Send text to DCC 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;
@ -187,26 +187,31 @@ 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)
dcc_chat_send(dcc, text);
else
dcc = NULL;
if (dcc != NULL && dcc->sendbuf != NULL)
dcc_chat_send(dcc, text);
if (dcc != NULL || *target == '=')
signal_stop();
}
cmd_params_free(free_arg);
}
static void cmd_me(const char *data, SERVER_REC *server, QUERY_REC *item)
static void cmd_me(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
{
CHAT_DCC_REC *dcc;
char *str;
g_return_if_fail(data != NULL);
dcc = item_get_dcc((WI_ITEM_REC *) item);
dcc = item_get_dcc(item);
if (dcc == NULL) return;
str = g_strconcat("ACTION ", data, NULL);