From 21b8e8e539d3bfd368a77da99331f581b257d347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Janouch?= Date: Sun, 26 Apr 2015 23:06:19 +0200 Subject: [PATCH] degesch: implement /list --- degesch.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/degesch.c b/degesch.c index 628c9d3..2ad7f3d 100644 --- a/degesch.c +++ b/degesch.c @@ -3422,6 +3422,19 @@ handle_command_part (struct app_context *ctx, char *arguments) 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 handle_command_quote (struct app_context *ctx, char *arguments) { @@ -3460,9 +3473,9 @@ g_command_handlers[] = "" }, { "join", handle_command_join, "Join channels", - "[channel...]" }, + "[[,...]]" }, { "part", handle_command_part, "Leave channels", - "[channel...]" }, + "[[,...]]" }, #if 0 { "cycle", NULL, "", "" }, @@ -3472,8 +3485,11 @@ g_command_handlers[] = { "kickban", NULL, "", "" }, { "ban", NULL, "", "" }, { "invite", NULL, "", "" }, +#endif - { "list", NULL, "", "" }, + { "list", handle_command_list, "List channels and their topic", + "[[,...]] [server]" }, +#if 0 { "names", NULL, "", "" }, { "who", NULL, "", "" }, { "whois", NULL, "", "" },