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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user