summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2007-06-06 09:08:00 +0000
committerSebastien Helleu <flashcode@flashtux.org>2007-06-06 09:08:00 +0000
commit23ff2668165f9128507e181206f5ad7647a6a7a7 (patch)
tree21c41f65c04db4b186147ab8cb6ec6cef1c05062 /src/irc
parent8affe52ee49c40d4a8ba4e4e0f448ed078451630 (diff)
downloadweechat-23ff2668165f9128507e181206f5ad7647a6a7a7.zip
Added missing IRC command 327
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/irc-commands.c2
-rw-r--r--src/irc/irc-recv.c67
-rw-r--r--src/irc/irc.h1
3 files changed, 70 insertions, 0 deletions
diff --git a/src/irc/irc-commands.c b/src/irc/irc-commands.c
index 97e9c70e3..f4cb90b45 100644
--- a/src/irc/irc-commands.c
+++ b/src/irc/irc-commands.c
@@ -353,6 +353,8 @@ t_irc_command irc_commands[] =
NULL, 0, 0, 0, 1, NULL, NULL, irc_recv_cmd_324 },
{ "326", N_("whois (has oper privs)"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_recv_cmd_whois_nick_msg },
+ { "327", N_("whois (host)"), "", "",
+ NULL, 0, 0, 0, 1, NULL, NULL, irc_recv_cmd_327 },
{ "329", N_("channel creation date"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_recv_cmd_329 },
{ "331", N_("no topic for channel"), "", "",
diff --git a/src/irc/irc-recv.c b/src/irc/irc-recv.c
index 011dbcbee..d88737aa0 100644
--- a/src/irc/irc-recv.c
+++ b/src/irc/irc-recv.c
@@ -3496,6 +3496,73 @@ irc_recv_cmd_324 (t_irc_server *server, char *host, char *nick, char *arguments)
}
/*
+ * irc_recv_cmd_327: '327' command (whois, host)
+ */
+
+int
+irc_recv_cmd_327 (t_irc_server *server, char *host, char *nick, char *arguments)
+{
+ char *pos_nick, *pos_host1, *pos_host2, *pos_other;
+
+ /* make C compiler happy */
+ (void) host;
+ (void) nick;
+
+ if (!command_ignored)
+ {
+ pos_nick = strchr (arguments, ' ');
+ if (pos_nick)
+ {
+ while (pos_nick[0] == ' ')
+ pos_nick++;
+ pos_host1 = strchr (pos_nick, ' ');
+ if (pos_host1)
+ {
+ pos_host1[0] = '\0';
+ pos_host1++;
+ while (pos_host1[0] == ' ')
+ pos_host1++;
+ pos_host2 = strchr (pos_host1, ' ');
+ if (pos_host2)
+ {
+ pos_host2[0] = '\0';
+ pos_host2++;
+ while (pos_host2[0] == ' ')
+ pos_host2++;
+
+ pos_other = strchr (pos_host2, ' ');
+ if (pos_other)
+ {
+ pos_other[0] = '\0';
+ pos_other++;
+ while (pos_other[0] == ' ')
+ pos_other++;
+ }
+
+ irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ gui_printf (server->buffer,
+ "%s[%s%s%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_HOST),
+ pos_host1,
+ pos_host2,
+ GUI_COLOR(COLOR_WIN_CHAT_DARK),
+ (pos_other) ? "(" : "",
+ GUI_COLOR(COLOR_WIN_CHAT),
+ (pos_other) ? pos_other : "",
+ GUI_COLOR(COLOR_WIN_CHAT_DARK),
+ (pos_other) ? ")" : "");
+ }
+ }
+ }
+ }
+ return 0;
+}
+
+/*
* irc_recv_cmd_329: '329' command received (channel creation date)
*/
diff --git a/src/irc/irc.h b/src/irc/irc.h
index 1ce76e8ab..cde4032ba 100644
--- a/src/irc/irc.h
+++ b/src/irc/irc.h
@@ -582,6 +582,7 @@ extern int irc_recv_cmd_321 (t_irc_server *, char *, char *, char *);
extern int irc_recv_cmd_322 (t_irc_server *, char *, char *, char *);
extern int irc_recv_cmd_323 (t_irc_server *, char *, char *, char *);
extern int irc_recv_cmd_324 (t_irc_server *, char *, char *, char *);
+extern int irc_recv_cmd_327 (t_irc_server *, char *, char *, char *);
extern int irc_recv_cmd_329 (t_irc_server *, char *, char *, char *);
extern int irc_recv_cmd_331 (t_irc_server *, char *, char *, char *);
extern int irc_recv_cmd_332 (t_irc_server *, char *, char *, char *);