aboutsummaryrefslogtreecommitdiff
path: root/degesch.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-04-27 23:06:20 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-04-27 23:06:20 +0200
commit4013921de777a455cd152752c78671db8f0062fa (patch)
treefcc056a5e0849e0191539f0a11068a430a7c8d36 /degesch.c
parent6f890c0388c063326d04c9210595c5164f364a89 (diff)
downloadxK-4013921de777a455cd152752c78671db8f0062fa.tar.gz
xK-4013921de777a455cd152752c78671db8f0062fa.tar.xz
xK-4013921de777a455cd152752c78671db8f0062fa.zip
degesch: add a /nick command
Somehow I've missed it entirely.
Diffstat (limited to 'degesch.c')
-rw-r--r--degesch.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/degesch.c b/degesch.c
index 6b8a241..274f437 100644
--- a/degesch.c
+++ b/degesch.c
@@ -3664,6 +3664,18 @@ handle_command_list (struct app_context *ctx, char *arguments)
}
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)
{
if (!server_command_check (ctx, "quote"))
@@ -3725,8 +3737,10 @@ g_command_handlers[] =
{ "motd", NULL, "", "" },
{ "away", NULL, "", "" },
#endif
+ { "nick", handle_command_nick, "Change current nick",
+ "<nickname>" },
{ "quote", handle_command_quote, "Send a raw command to the server",
- "command" },
+ "<command>" },
};
static bool