mirror of
https://github.com/irssi/irssi.git
synced 2024-11-03 04:27:19 -05: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:
parent
eddc3d90c6
commit
137aaeb499
@ -226,7 +226,7 @@ static void sig_dcc_list_print(CHAT_DCC_REC *dcc)
|
|||||||
dcc->id, "CHAT");
|
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;
|
CHAT_DCC_REC *dcc;
|
||||||
GHashTable *optlist;
|
GHashTable *optlist;
|
||||||
@ -240,19 +240,23 @@ static void cmd_msg(const char *data)
|
|||||||
&optlist, &target, &text))
|
&optlist, &target, &text))
|
||||||
return;
|
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);
|
dcc = dcc_chat_find_id(target+1);
|
||||||
if (dcc == NULL || dcc->sendbuf == NULL) {
|
else
|
||||||
|
dcc = NULL;
|
||||||
|
|
||||||
|
if (dcc == NULL && *target == '=') {
|
||||||
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
|
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
|
||||||
IRCTXT_DCC_CHAT_NOT_FOUND, target+1);
|
IRCTXT_DCC_CHAT_NOT_FOUND, target+1);
|
||||||
} else {
|
} else if (dcc != NULL) {
|
||||||
if (query_find(NULL, target) == NULL)
|
if (query_find(NULL, target) == NULL)
|
||||||
completion_last_message_add(target);
|
completion_last_message_add(target);
|
||||||
|
|
||||||
signal_emit("message dcc own", 2, dcc, text);
|
signal_emit("message dcc own", 2, dcc, text);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
cmd_params_free(free_arg);
|
cmd_params_free(free_arg);
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,7 @@ CHAT_DCC_REC *item_get_dcc(WI_ITEM_REC *item)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Send text to DCC chat */
|
/* 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;
|
CHAT_DCC_REC *dcc;
|
||||||
GHashTable *optlist;
|
GHashTable *optlist;
|
||||||
@ -187,26 +187,31 @@ static void cmd_msg(const char *data)
|
|||||||
&optlist, &target, &text))
|
&optlist, &target, &text))
|
||||||
return;
|
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);
|
dcc = dcc_chat_find_id(target+1);
|
||||||
|
else
|
||||||
|
dcc = NULL;
|
||||||
|
|
||||||
if (dcc != NULL && dcc->sendbuf != NULL)
|
if (dcc != NULL && dcc->sendbuf != NULL)
|
||||||
dcc_chat_send(dcc, text);
|
dcc_chat_send(dcc, text);
|
||||||
|
|
||||||
|
if (dcc != NULL || *target == '=')
|
||||||
signal_stop();
|
signal_stop();
|
||||||
}
|
|
||||||
|
|
||||||
cmd_params_free(free_arg);
|
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;
|
CHAT_DCC_REC *dcc;
|
||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
g_return_if_fail(data != NULL);
|
g_return_if_fail(data != NULL);
|
||||||
|
|
||||||
dcc = item_get_dcc((WI_ITEM_REC *) item);
|
dcc = item_get_dcc(item);
|
||||||
if (dcc == NULL) return;
|
if (dcc == NULL) return;
|
||||||
|
|
||||||
str = g_strconcat("ACTION ", data, NULL);
|
str = g_strconcat("ACTION ", data, NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user