aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-07-02 20:50:53 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-07-02 20:50:53 +0200
commit15882dcdf9d430cbefcc949bd3972656c58819e5 (patch)
tree8b177c45839f419361327ac86c654238e4d5856a
parentb4869652775416dde95cfc103d4b03b04828bf60 (diff)
downloadxK-15882dcdf9d430cbefcc949bd3972656c58819e5.tar.gz
xK-15882dcdf9d430cbefcc949bd3972656c58819e5.tar.xz
xK-15882dcdf9d430cbefcc949bd3972656c58819e5.zip
degesch: part channel on /buffer close
-rw-r--r--degesch.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/degesch.c b/degesch.c
index 2dd1ebc..4934d7d 100644
--- a/degesch.c
+++ b/degesch.c
@@ -2622,8 +2622,6 @@ buffer_remove (struct app_context *ctx, struct buffer *buffer)
{
hard_assert (buffer != ctx->current_buffer);
- // TODO: part from the channel if needed
-
input_destroy_buffer (&ctx->input, buffer->input_data);
buffer->input_data = NULL;
@@ -6091,6 +6089,10 @@ handle_buffer_close (struct app_context *ctx, struct handler_args *a)
log_global_error (ctx, "Can't close a server buffer");
else
{
+ // The user would be unable to recreate the buffer otherwise
+ if (buffer->type == BUFFER_CHANNEL)
+ irc_send (buffer->server, "PART %s", buffer->channel->name);
+
if (buffer == ctx->current_buffer)
buffer_activate (ctx, buffer_next (ctx, 1));
buffer_remove (ctx, buffer);