aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--degesch.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/degesch.c b/degesch.c
index 0b709bb..34a7975 100644
--- a/degesch.c
+++ b/degesch.c
@@ -6857,6 +6857,27 @@ handle_command_alias (struct handler_args *a)
}
static bool
+handle_command_unalias (struct handler_args *a)
+{
+ if (!*a->arguments)
+ return false;
+
+ struct str_map *aliases = get_aliases_config (a->ctx);
+ while (*a->arguments)
+ {
+ char *name = cut_word (&a->arguments);
+ if (!str_map_find (aliases, name))
+ log_global_error (a->ctx, "No such alias: #s", name);
+ else
+ {
+ str_map_set (aliases, name, NULL);
+ log_global_status (a->ctx, "Alias removed: #s", name);
+ }
+ }
+ return true;
+}
+
+static bool
handle_command_msg (struct handler_args *a)
{
if (!*a->arguments)
@@ -7455,6 +7476,9 @@ g_command_handlers[] =
{ "alias", "List or set aliases",
"[<name> <definition>]",
handle_command_alias, 0 },
+ { "unalias", "Unset aliases",
+ "<name>...",
+ handle_command_unalias, 0 },
{ "msg", "Send message to a nick or channel",
"<target> <message>",