1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-30 06:46:38 +02:00

irc: display an error with /allchan -current or /allpv -current if the current buffer is not an irc buffer (closes #1325)

This commit is contained in:
Sébastien Helleu
2019-03-19 20:37:06 +01:00
parent 766bea3f9e
commit bb017b2613
16 changed files with 177 additions and 39 deletions
+20
View File
@@ -533,6 +533,16 @@ IRC_COMMAND_CALLBACK(allchan)
{
if (weechat_strcasecmp (argv[i], "-current") == 0)
{
if (!ptr_server)
{
weechat_printf (NULL,
_("%s%s: command \"%s\" with option "
"\"%s\" must be executed on "
"irc buffer (server, channel or private)"),
weechat_prefix ("error"), IRC_PLUGIN_NAME,
"allchan", "-current");
return WEECHAT_RC_OK;
}
current_server = 1;
ptr_command = argv_eol[i + 1];
}
@@ -592,6 +602,16 @@ IRC_COMMAND_CALLBACK(allpv)
{
if (weechat_strcasecmp (argv[i], "-current") == 0)
{
if (!ptr_server)
{
weechat_printf (NULL,
_("%s%s: command \"%s\" with option "
"\"%s\" must be executed on "
"irc buffer (server, channel or private)"),
weechat_prefix ("error"), IRC_PLUGIN_NAME,
"allpv", "-current");
return WEECHAT_RC_OK;
}
current_server = 1;
ptr_command = argv_eol[i + 1];
}