mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Don't allow sending data to dcc chats if connection isn't finished yet.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@630 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
776895eeac
commit
2e886d62f5
@ -306,7 +306,7 @@ static void cmd_msg(const char *data)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
dcc = dcc_find_item(DCC_TYPE_CHAT, target+1, NULL);
|
dcc = dcc_find_item(DCC_TYPE_CHAT, target+1, NULL);
|
||||||
if (dcc == NULL) {
|
if (dcc == NULL || dcc->sendbuf == NULL) {
|
||||||
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 {
|
||||||
@ -349,7 +349,7 @@ static void cmd_action(const char *data, SERVER_REC *server, WI_IRC_REC *item)
|
|||||||
if (*target == '\0' || *text == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
|
if (*target == '\0' || *text == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
|
||||||
|
|
||||||
dcc = dcc_find_item(DCC_TYPE_CHAT, target+1, NULL);
|
dcc = dcc_find_item(DCC_TYPE_CHAT, target+1, NULL);
|
||||||
if (dcc == NULL) {
|
if (dcc == NULL || dcc->sendbuf == NULL) {
|
||||||
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 {
|
||||||
@ -379,7 +379,7 @@ static void cmd_ctcp(const char *data, SERVER_REC *server)
|
|||||||
}
|
}
|
||||||
|
|
||||||
dcc = dcc_find_item(DCC_TYPE_CHAT, target+1, NULL);
|
dcc = dcc_find_item(DCC_TYPE_CHAT, target+1, NULL);
|
||||||
if (dcc == NULL) {
|
if (dcc == NULL || dcc->sendbuf == NULL) {
|
||||||
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 {
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
void dcc_chat_send(DCC_REC *dcc, const char *data)
|
void dcc_chat_send(DCC_REC *dcc, const char *data)
|
||||||
{
|
{
|
||||||
g_return_if_fail(dcc != NULL);
|
g_return_if_fail(dcc != NULL);
|
||||||
|
g_return_if_fail(dcc->sendbuf != NULL);
|
||||||
g_return_if_fail(data != NULL);
|
g_return_if_fail(data != NULL);
|
||||||
|
|
||||||
net_sendbuffer_send(dcc->sendbuf, data, strlen(data));
|
net_sendbuffer_send(dcc->sendbuf, data, strlen(data));
|
||||||
@ -73,7 +74,8 @@ static void cmd_msg(const char *data)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
dcc = dcc_find_item(DCC_TYPE_CHAT, ++target, NULL);
|
dcc = dcc_find_item(DCC_TYPE_CHAT, ++target, NULL);
|
||||||
if (dcc != NULL) dcc_chat_send(dcc, text);
|
if (dcc != NULL && dcc->sendbuf != NULL)
|
||||||
|
dcc_chat_send(dcc, text);
|
||||||
|
|
||||||
cmd_params_free(free_arg);
|
cmd_params_free(free_arg);
|
||||||
signal_stop();
|
signal_stop();
|
||||||
|
@ -201,7 +201,7 @@ void dcc_ctcp_message(const char *target, IRC_SERVER_REC *server, DCC_REC *chat,
|
|||||||
{
|
{
|
||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
if (chat != NULL) {
|
if (chat != NULL && chat->sendbuf != NULL) {
|
||||||
/* send it via open DCC chat */
|
/* send it via open DCC chat */
|
||||||
str = g_strdup_printf("%s\001%s\001", chat->mirc_ctcp ? "" :
|
str = g_strdup_printf("%s\001%s\001", chat->mirc_ctcp ? "" :
|
||||||
notice ? "CTCP_REPLY " : "CTCP_MESSAGE ", msg);
|
notice ? "CTCP_REPLY " : "CTCP_MESSAGE ", msg);
|
||||||
|
Loading…
Reference in New Issue
Block a user