From 4013921de777a455cd152752c78671db8f0062fa Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Mon, 27 Apr 2015 23:06:20 +0200
Subject: degesch: add a /nick command
Somehow I've missed it entirely.
---
degesch.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/degesch.c b/degesch.c
index 6b8a241..274f437 100644
--- a/degesch.c
+++ b/degesch.c
@@ -3663,6 +3663,18 @@ handle_command_list (struct app_context *ctx, char *arguments)
return true;
}
+static bool
+handle_command_nick (struct app_context *ctx, char *arguments)
+{
+ if (!server_command_check (ctx, "change nickname"))
+ return true;
+ if (!*arguments)
+ return false;
+
+ irc_send (ctx, "NICK %s", cut_word (&arguments));
+ return true;
+}
+
static bool
handle_command_quote (struct app_context *ctx, char *arguments)
{
@@ -3725,8 +3737,10 @@ g_command_handlers[] =
{ "motd", NULL, "", "" },
{ "away", NULL, "", "" },
#endif
+ { "nick", handle_command_nick, "Change current nick",
+ "" },
{ "quote", handle_command_quote, "Send a raw command to the server",
- "command" },
+ "" },
};
static bool
--
cgit v1.2.3-70-g09d2