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

core: display an error message when "/buffer notify xxx" fails (with a wrong notify level)

This commit is contained in:
Sebastien Helleu
2013-08-21 11:18:52 +02:00
parent 64bbb327bb
commit fc1e35fb48
14 changed files with 75 additions and 21 deletions
+7 -1
View File
@@ -846,7 +846,13 @@ COMMAND_CALLBACK(buffer)
if (string_strcasecmp (argv[1], "notify") == 0)
{
COMMAND_MIN_ARGS(3, "buffer notify");
config_weechat_notify_set (buffer, argv_eol[2]);
if (!config_weechat_notify_set (buffer, argv_eol[2]))
{
gui_chat_printf (NULL,
_("%sError: unable to set notify level \"%s\""),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
argv_eol[2]);
}
return WEECHAT_RC_OK;
}
+6 -7
View File
@@ -1692,13 +1692,12 @@ config_weechat_notify_set (struct t_gui_buffer *buffer, const char *notify)
return 0;
/* create/update option */
config_weechat_notify_create_option_cb (NULL,
weechat_config_file,
weechat_config_section_notify,
buffer->full_name,
(value < 0) ?
NULL : gui_buffer_notify_string[value]);
return 1;
return (config_weechat_notify_create_option_cb (NULL,
weechat_config_file,
weechat_config_section_notify,
buffer->full_name,
(value < 0) ?
NULL : gui_buffer_notify_string[value]) != WEECHAT_CONFIG_OPTION_SET_ERROR) ? 1 : 0;
}
/*