summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWouter Coekaerts <coekie@irssi.org>2010-02-27 18:52:41 +0000
committercoekie <coekie@dbcabf3a-b0e7-0310-adc4-f8d773084564>2010-02-27 18:52:41 +0000
commit4b751d9df66829622c8e0d4c827cfaa2ff317c10 (patch)
treea4f904601713cff58064c54703b05a36e3d78be1
parent3eea03ccb81578fac0cb677d419c8176c5e30078 (diff)
downloadirssi-4b751d9df66829622c8e0d4c827cfaa2ff317c10.zip
Use servertag from the active DCC chat when not connected anymore to the IRC server that started it. This fixes a crash with handling the DCC queue. Reported by Aurelien Delaitre (SATE 2009)
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5122 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r--src/irc/dcc/dcc-send.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/irc/dcc/dcc-send.c b/src/irc/dcc/dcc-send.c
index 9b5d1189..78ccf01d 100644
--- a/src/irc/dcc/dcc-send.c
+++ b/src/irc/dcc/dcc-send.c
@@ -183,10 +183,12 @@ static void cmd_dcc_send(const char *data, IRC_SERVER_REC *server,
(chat->mirc_ctcp || g_strcasecmp(nick, chat->nick) != 0))
chat = NULL;
- if (!IS_IRC_SERVER(server) || !server->connected)
- servertag = NULL;
- else
+ if (IS_IRC_SERVER(server) && server->connected)
servertag = server->tag;
+ else if (chat != NULL)
+ servertag = chat->servertag;
+ else
+ servertag = NULL;
if (servertag == NULL && chat == NULL)
cmd_param_error(CMDERR_NOT_CONNECTED);