summaryrefslogtreecommitdiff
path: root/src/plugins/irc
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2015-01-17 15:18:50 +0100
committerSébastien Helleu <flashcode@flashtux.org>2015-01-17 15:18:50 +0100
commit99d20e97c61c917db3d65c68a094dcfc4a2d7eb1 (patch)
treebf8b36bbde71977517b90d8592ac0da1a50ee9eb /src/plugins/irc
parent0d60871ec6c7d6694378d8665ac791be2c660326 (diff)
downloadweechat-99d20e97c61c917db3d65c68a094dcfc4a2d7eb1.zip
irc: send QUIT to server and no PART for channels when the server buffer is closed (closes #294)
Diffstat (limited to 'src/plugins/irc')
-rw-r--r--src/plugins/irc/irc-buffer.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/irc/irc-buffer.c b/src/plugins/irc/irc-buffer.c
index ac4849c4c..c7daa2c23 100644
--- a/src/plugins/irc/irc-buffer.c
+++ b/src/plugins/irc/irc-buffer.c
@@ -141,16 +141,20 @@ irc_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
{
if (ptr_server)
{
- /* send PART on all channels for server, then disconnect from server */
+ if (!ptr_server->disconnected)
+ {
+ /* send QUIT to server, then disconnect */
+ irc_command_quit_server (ptr_server, NULL);
+ irc_server_disconnect (ptr_server, 0, 0);
+ }
ptr_channel = ptr_server->channels;
while (ptr_channel)
{
next_channel = ptr_channel->next_channel;
- weechat_buffer_close (ptr_channel->buffer);
+ if (ptr_channel->buffer != buffer)
+ weechat_buffer_close (ptr_channel->buffer);
ptr_channel = next_channel;
}
- if (!ptr_server->disconnected)
- irc_server_disconnect (ptr_server, 0, 0);
ptr_server->buffer = NULL;
}
}