degesch: implement /list

This commit is contained in:
Přemysl Eric Janouch 2015-04-26 23:06:19 +02:00
parent 54262e2d20
commit 21b8e8e539
1 changed files with 19 additions and 3 deletions

View File

@ -3422,6 +3422,19 @@ handle_command_part (struct app_context *ctx, char *arguments)
return true; return true;
} }
static bool
handle_command_list (struct app_context *ctx, char *arguments)
{
if (!server_command_check (ctx, "list channels"))
return true;
if (*arguments)
irc_send (ctx, "LIST %s", arguments);
else
irc_send (ctx, "LIST");
return true;
}
static bool static bool
handle_command_quote (struct app_context *ctx, char *arguments) handle_command_quote (struct app_context *ctx, char *arguments)
{ {
@ -3460,9 +3473,9 @@ g_command_handlers[] =
"<message>" }, "<message>" },
{ "join", handle_command_join, "Join channels", { "join", handle_command_join, "Join channels",
"[channel...]" }, "[<channel>[,<channel>...]]" },
{ "part", handle_command_part, "Leave channels", { "part", handle_command_part, "Leave channels",
"[channel...]" }, "[<channel>[,<channel>...]]" },
#if 0 #if 0
{ "cycle", NULL, "", "" }, { "cycle", NULL, "", "" },
@ -3472,8 +3485,11 @@ g_command_handlers[] =
{ "kickban", NULL, "", "" }, { "kickban", NULL, "", "" },
{ "ban", NULL, "", "" }, { "ban", NULL, "", "" },
{ "invite", NULL, "", "" }, { "invite", NULL, "", "" },
#endif
{ "list", NULL, "", "" }, { "list", handle_command_list, "List channels and their topic",
"[<channel>[,<channel>...]] [server]" },
#if 0
{ "names", NULL, "", "" }, { "names", NULL, "", "" },
{ "who", NULL, "", "" }, { "who", NULL, "", "" },
{ "whois", NULL, "", "" }, { "whois", NULL, "", "" },