From 70d6af7a0ede5eddcb17a0d1a3b29422238510d1 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sat, 5 Aug 2006 20:05:53 +0000 Subject: Added missing IRC command 338 --- src/irc/irc-commands.c | 2 ++ src/irc/irc-recv.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/irc/irc.h | 1 + 3 files changed, 59 insertions(+) (limited to 'src') diff --git a/src/irc/irc-commands.c b/src/irc/irc-commands.c index ddc295f20..fc9a7feca 100644 --- a/src/irc/irc-commands.c +++ b/src/irc/irc-commands.c @@ -358,6 +358,8 @@ t_irc_command irc_commands[] = NULL, 2, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_332 }, { "333", N_("infos about topic (nick and date changed)"), "", "", NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_333 }, + { "338", N_("whois (host))"), "", "", + NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_338 }, { "341", N_("inviting"), "", "", NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_341 }, { "344", N_("channel reop"), "", "", diff --git a/src/irc/irc-recv.c b/src/irc/irc-recv.c index f89c5b288..b9441d6a5 100644 --- a/src/irc/irc-recv.c +++ b/src/irc/irc-recv.c @@ -4196,6 +4196,62 @@ irc_cmd_recv_333 (t_irc_server *server, char *host, char *nick, char *arguments) return 0; } +/* + * irc_cmd_recv_338: '338' command (whois, host) + */ + +int +irc_cmd_recv_338 (t_irc_server *server, char *host, char *nick, char *arguments) +{ + char *pos_nick, *pos_host, *pos_message; + + /* make gcc happy */ + (void) host; + (void) nick; + + if (!command_ignored) + { + pos_nick = strchr (arguments, ' '); + if (pos_nick) + { + while (pos_nick[0] == ' ') + pos_nick++; + pos_host = strchr (pos_nick, ' '); + if (pos_host) + { + pos_host[0] = '\0'; + pos_host++; + while (pos_host[0] == ' ') + pos_host++; + pos_message = strchr (pos_host, ' '); + if (pos_message) + { + pos_message[0] = '\0'; + pos_message++; + while (pos_message[0] == ' ') + pos_message++; + if (pos_message[0] == ':') + pos_message++; + + irc_display_prefix (server, server->buffer, PREFIX_SERVER); + gui_printf (server->buffer, "%s[%s%s%s] %s%s %s%s %s%s\n", + GUI_COLOR(COLOR_WIN_CHAT_DARK), + GUI_COLOR(COLOR_WIN_CHAT_NICK), + pos_nick, + GUI_COLOR(COLOR_WIN_CHAT_DARK), + GUI_COLOR(COLOR_WIN_CHAT_NICK), + pos_nick, + GUI_COLOR(COLOR_WIN_CHAT), + pos_message, + GUI_COLOR(COLOR_WIN_CHAT_HOST), + pos_host); + } + } + } + } + return 0; +} + /* * irc_cmd_recv_341: '341' command received (inviting) */ diff --git a/src/irc/irc.h b/src/irc/irc.h index 17822cf1d..62b8364cb 100644 --- a/src/irc/irc.h +++ b/src/irc/irc.h @@ -572,6 +572,7 @@ extern int irc_cmd_recv_329 (t_irc_server *, char *, char *, char *); extern int irc_cmd_recv_331 (t_irc_server *, char *, char *, char *); extern int irc_cmd_recv_332 (t_irc_server *, char *, char *, char *); extern int irc_cmd_recv_333 (t_irc_server *, char *, char *, char *); +extern int irc_cmd_recv_338 (t_irc_server *, char *, char *, char *); extern int irc_cmd_recv_341 (t_irc_server *, char *, char *, char *); extern int irc_cmd_recv_344 (t_irc_server *, char *, char *, char *); extern int irc_cmd_recv_345 (t_irc_server *, char *, char *, char *); -- cgit v1.2.3