1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-01 07:16:37 +02:00

core: save and restore mute state in command /mute (bug #41748)

This commit is contained in:
Sebastien Helleu
2014-03-04 14:42:35 +01:00
parent 2b2c729854
commit 12b82146aa
2 changed files with 11 additions and 4 deletions
+1
View File
@@ -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
+10 -4
View File
@@ -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;