summaryrefslogtreecommitdiff
path: root/src/irc/dcc
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-08-25 22:53:22 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-08-25 22:53:22 +0000
commit2e886d62f5342e41ddb9dfc8660036667214b1c5 (patch)
treee089f635bca1f27cd88e0ef60aeeee7c1f722851 /src/irc/dcc
parent776895eeac1e0936824ab4419ed5bbf77878576c (diff)
downloadirssi-2e886d62f5342e41ddb9dfc8660036667214b1c5.zip
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
Diffstat (limited to 'src/irc/dcc')
-rw-r--r--src/irc/dcc/dcc-chat.c4
-rw-r--r--src/irc/dcc/dcc.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/irc/dcc/dcc-chat.c b/src/irc/dcc/dcc-chat.c
index e8fdd2ad..f1d9daba 100644
--- a/src/irc/dcc/dcc-chat.c
+++ b/src/irc/dcc/dcc-chat.c
@@ -38,6 +38,7 @@
void dcc_chat_send(DCC_REC *dcc, const char *data)
{
g_return_if_fail(dcc != NULL);
+ g_return_if_fail(dcc->sendbuf != NULL);
g_return_if_fail(data != NULL);
net_sendbuffer_send(dcc->sendbuf, data, strlen(data));
@@ -73,7 +74,8 @@ static void cmd_msg(const char *data)
return;
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);
signal_stop();
diff --git a/src/irc/dcc/dcc.c b/src/irc/dcc/dcc.c
index b2aeddcf..f3f96a20 100644
--- a/src/irc/dcc/dcc.c
+++ b/src/irc/dcc/dcc.c
@@ -201,7 +201,7 @@ void dcc_ctcp_message(const char *target, IRC_SERVER_REC *server, DCC_REC *chat,
{
char *str;
- if (chat != NULL) {
+ if (chat != NULL && chat->sendbuf != NULL) {
/* send it via open DCC chat */
str = g_strdup_printf("%s\001%s\001", chat->mirc_ctcp ? "" :
notice ? "CTCP_REPLY " : "CTCP_MESSAGE ", msg);