diff options
Diffstat (limited to 'src/plugins/irc')
-rw-r--r-- | src/plugins/irc/irc-buffer.c | 12 |
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; } } |