degesch: add a /nick command

Somehow I've missed it entirely.
This commit is contained in:
Přemysl Eric Janouch 2015-04-27 23:06:20 +02:00
parent 6f890c0388
commit 4013921de7
1 changed files with 15 additions and 1 deletions

View File

@ -3663,6 +3663,18 @@ handle_command_list (struct app_context *ctx, char *arguments)
return true; 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 static bool
handle_command_quote (struct app_context *ctx, char *arguments) handle_command_quote (struct app_context *ctx, char *arguments)
{ {
@ -3725,8 +3737,10 @@ g_command_handlers[] =
{ "motd", NULL, "", "" }, { "motd", NULL, "", "" },
{ "away", NULL, "", "" }, { "away", NULL, "", "" },
#endif #endif
{ "nick", handle_command_nick, "Change current nick",
"<nickname>" },
{ "quote", handle_command_quote, "Send a raw command to the server", { "quote", handle_command_quote, "Send a raw command to the server",
"command" }, "<command>" },
}; };
static bool static bool