diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2021-06-03 00:07:11 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2021-06-03 00:12:22 +0200 |
commit | 80c1e8f8eb016fff43e6b1f1bbf6aa512d321b16 (patch) | |
tree | 19cb64db2532dd665a8317c7583a0adaf7718ddd /degesch.c | |
parent | c5f49ab1e66578335fec162a1dec079080a25dfa (diff) | |
download | xK-80c1e8f8eb016fff43e6b1f1bbf6aa512d321b16.tar.gz xK-80c1e8f8eb016fff43e6b1f1bbf6aa512d321b16.tar.xz xK-80c1e8f8eb016fff43e6b1f1bbf6aa512d321b16.zip |
degesch: make /deop and /devoice default to self
It's pretty annoying to type `/mode -o <user>`, for little reason.
Diffstat (limited to 'degesch.c')
-rw-r--r-- | degesch.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -11920,11 +11920,17 @@ static bool handle_command_channel_mode (struct handler_args *a, bool adding, char mode_char) { - if (!*a->arguments) - return false; + const char *targets = a->arguments; + if (!*targets) + { + if (adding) + return false; + + targets = a->s->irc_user->nickname; + } 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); strv_free (&v); return true; @@ -12031,13 +12037,13 @@ g_command_handlers[] = "<nick>...", handle_command_op, HANDLER_SERVER | HANDLER_CHANNEL_FIRST }, { "deop", "Remove channel operator status", - "<nick>...", + "[<nick>...]", handle_command_deop, HANDLER_SERVER | HANDLER_CHANNEL_FIRST }, { "voice", "Give voice", "<nick>...", handle_command_voice, HANDLER_SERVER | HANDLER_CHANNEL_FIRST }, { "devoice", "Remove voice", - "<nick>...", + "[<nick>...]", handle_command_devoice, HANDLER_SERVER | HANDLER_CHANNEL_FIRST }, { "mode", "Change mode", |