diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2006-08-05 20:05:53 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2006-08-05 20:05:53 +0000 |
commit | 70d6af7a0ede5eddcb17a0d1a3b29422238510d1 (patch) | |
tree | b4930a1acd35407f4e27876ded350593a485aa69 /src | |
parent | fb607cb4abe142758e68062110fd1480d319d84a (diff) | |
download | weechat-70d6af7a0ede5eddcb17a0d1a3b29422238510d1.zip |
Added missing IRC command 338
Diffstat (limited to 'src')
-rw-r--r-- | src/irc/irc-commands.c | 2 | ||||
-rw-r--r-- | src/irc/irc-recv.c | 56 | ||||
-rw-r--r-- | src/irc/irc.h | 1 |
3 files changed, 59 insertions, 0 deletions
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 @@ -4197,6 +4197,62 @@ irc_cmd_recv_333 (t_irc_server *server, char *host, char *nick, char *arguments) } /* + * 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 *); |