summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2014-03-04 14:42:35 +0100
committerSebastien Helleu <flashcode@flashtux.org>2014-03-04 14:42:35 +0100
commit12b82146aac152153e427f65faa60b502829236a (patch)
treeab017c87617601b6ebc875042f279b062eebaa07
parent2b2c729854fbb04e7bca3a90b4a92bac4b5a4149 (diff)
downloadweechat-12b82146aac152153e427f65faa60b502829236a.zip
core: save and restore mute state in command /mute (bug #41748)
-rw-r--r--ChangeLog1
-rw-r--r--src/core/wee-command.c14
2 files changed, 11 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index eb72670fe..8844c3f24 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
== Version 0.4.4 (under dev)
+* core: save and restore mute state in command /mute (bug #41748)
* core: fix memory leak when removing a hdata
* core: fix memory leak in evaluation of sub-conditions
* core: fix memory leak in function gui_key_add_to_infolist (in case of
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index 358336ea9..b4b706b8d 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -3739,9 +3739,9 @@ COMMAND_CALLBACK(mouse)
COMMAND_CALLBACK(mute)
{
- int length, mute_mode;
+ int length, mute_mode, gui_chat_mute_old;
char *command, *ptr_command;
- struct t_gui_buffer *mute_buffer, *ptr_buffer;
+ struct t_gui_buffer *mute_buffer, *ptr_buffer, *gui_chat_mute_buffer_old;
/* make C compiler happy */
(void) data;
@@ -3752,6 +3752,9 @@ COMMAND_CALLBACK(mute)
return WEECHAT_RC_OK;
}
+ gui_chat_mute_old = gui_chat_mute;
+ gui_chat_mute_buffer_old = gui_chat_mute_buffer;
+
mute_mode = GUI_CHAT_MUTE_BUFFER;
mute_buffer = gui_buffer_search_main ();
ptr_command = argv_eol[1];
@@ -3798,8 +3801,11 @@ COMMAND_CALLBACK(mute)
}
}
- gui_chat_mute = GUI_CHAT_MUTE_DISABLED;
- gui_chat_mute_buffer = NULL;
+ gui_chat_mute = gui_chat_mute_old;
+ gui_chat_mute_buffer =
+ (gui_chat_mute_buffer_old
+ && gui_buffer_valid (gui_chat_mute_buffer_old)) ?
+ gui_chat_mute_buffer_old : NULL;
}
return WEECHAT_RC_OK;