From 2aa70c7ead5b3b38f04fafc9807c8138bb6a62f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Tue, 10 Sep 2019 14:57:50 +0200 Subject: [PATCH] commands: Fix the server delete command. --- matrix/commands.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/matrix/commands.py b/matrix/commands.py index 99b6889..cdb6444 100644 --- a/matrix/commands.py +++ b/matrix/commands.py @@ -1547,7 +1547,7 @@ def matrix_server_command_delete(args): W.prnt("", message) return - for buf in server.buffers.values(): + for buf in list(server.buffers.values()): W.buffer_close(buf) if server.server_buffer: @@ -1556,6 +1556,10 @@ def matrix_server_command_delete(args): for option in server.config._option_ptrs.values(): W.config_option_free(option) + if server.timer_hook: + W.unhook(server.timer_hook) + server.timer_hook = None + message = ( "matrix: server {color}{server}{ncolor} has been " "deleted" ).format(