degesch: make /deop and /devoice default to self
It's pretty annoying to type `/mode -o <user>`, for little reason.
This commit is contained in:
parent
c5f49ab1e6
commit
80c1e8f8eb
2
NEWS
2
NEWS
|
@ -9,6 +9,8 @@
|
||||||
|
|
||||||
* degesch: added support for IRCv3 chghost
|
* degesch: added support for IRCv3 chghost
|
||||||
|
|
||||||
|
* degesch: /deop and /devoice without arguments will use the client's user
|
||||||
|
|
||||||
* censor.lua: now stripping colours from censored messages;
|
* censor.lua: now stripping colours from censored messages;
|
||||||
their attributes are also configurable rather than always black on black
|
their attributes are also configurable rather than always black on black
|
||||||
|
|
||||||
|
|
14
degesch.c
14
degesch.c
|
@ -11920,11 +11920,17 @@ static bool
|
||||||
handle_command_channel_mode
|
handle_command_channel_mode
|
||||||
(struct handler_args *a, bool adding, char mode_char)
|
(struct handler_args *a, bool adding, char mode_char)
|
||||||
{
|
{
|
||||||
if (!*a->arguments)
|
const char *targets = a->arguments;
|
||||||
|
if (!*targets)
|
||||||
|
{
|
||||||
|
if (adding)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
targets = a->s->irc_user->nickname;
|
||||||
|
}
|
||||||
|
|
||||||
struct strv v = strv_make ();
|
struct strv v = strv_make ();
|
||||||
cstr_split (a->arguments, " ", true, &v);
|
cstr_split (targets, " ", true, &v);
|
||||||
mass_channel_mode (a->s, a->channel_name, adding, mode_char, &v);
|
mass_channel_mode (a->s, a->channel_name, adding, mode_char, &v);
|
||||||
strv_free (&v);
|
strv_free (&v);
|
||||||
return true;
|
return true;
|
||||||
|
@ -12031,13 +12037,13 @@ g_command_handlers[] =
|
||||||
"<nick>...",
|
"<nick>...",
|
||||||
handle_command_op, HANDLER_SERVER | HANDLER_CHANNEL_FIRST },
|
handle_command_op, HANDLER_SERVER | HANDLER_CHANNEL_FIRST },
|
||||||
{ "deop", "Remove channel operator status",
|
{ "deop", "Remove channel operator status",
|
||||||
"<nick>...",
|
"[<nick>...]",
|
||||||
handle_command_deop, HANDLER_SERVER | HANDLER_CHANNEL_FIRST },
|
handle_command_deop, HANDLER_SERVER | HANDLER_CHANNEL_FIRST },
|
||||||
{ "voice", "Give voice",
|
{ "voice", "Give voice",
|
||||||
"<nick>...",
|
"<nick>...",
|
||||||
handle_command_voice, HANDLER_SERVER | HANDLER_CHANNEL_FIRST },
|
handle_command_voice, HANDLER_SERVER | HANDLER_CHANNEL_FIRST },
|
||||||
{ "devoice", "Remove voice",
|
{ "devoice", "Remove voice",
|
||||||
"<nick>...",
|
"[<nick>...]",
|
||||||
handle_command_devoice, HANDLER_SERVER | HANDLER_CHANNEL_FIRST },
|
handle_command_devoice, HANDLER_SERVER | HANDLER_CHANNEL_FIRST },
|
||||||
|
|
||||||
{ "mode", "Change mode",
|
{ "mode", "Change mode",
|
||||||
|
|
Loading…
Reference in New Issue