summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2006-08-17 12:00:49 +0000
committerSebastien Helleu <flashcode@flashtux.org>2006-08-17 12:00:49 +0000
commit9f88f68e3b350256fe964ba73175400e0e8572e3 (patch)
treecdc374643c7039ec3166aac03165fbb344976cad /src/irc
parent5a0461ac6938ea3aab57826b94021fde54b30541 (diff)
downloadweechat-9f88f68e3b350256fe964ba73175400e0e8572e3.zip
Added missing IRC commands: 310, 326
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/irc-commands.c14
-rw-r--r--src/irc/irc-recv.c187
-rw-r--r--src/irc/irc.h7
3 files changed, 46 insertions, 162 deletions
diff --git a/src/irc/irc-commands.c b/src/irc/irc-commands.c
index f9975acb3..d2b97ff1c 100644
--- a/src/irc/irc-commands.c
+++ b/src/irc/irc-commands.c
@@ -320,13 +320,15 @@ t_irc_command irc_commands[] =
{ "306", N_("now away"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_306 },
{ "307", N_("whois (registered nick)"), "", "",
- NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_307 },
+ NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_whois_nick_msg },
+ { "310", N_("whois (help mode)"), "", "",
+ NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_310 },
{ "311", N_("whois (user)"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_311 },
{ "312", N_("whois (server)"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_312 },
{ "313", N_("whois (operator)"), "", "",
- NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_313 },
+ NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_whois_nick_msg },
{ "314", N_("whowas"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_314 },
{ "315", N_("end of /who list"), "", "",
@@ -334,11 +336,11 @@ t_irc_command irc_commands[] =
{ "317", N_("whois (idle)"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_317 },
{ "318", N_("whois (end)"), "", "",
- NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_318 },
+ NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_whois_nick_msg },
{ "319", N_("whois (channels)"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_319 },
{ "320", N_("whois (identified user)"), "", "",
- NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_320 },
+ NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_whois_nick_msg },
{ "321", N_("/list start"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_321 },
{ "322", N_("channel (for /list)"), "", "",
@@ -347,8 +349,8 @@ t_irc_command irc_commands[] =
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_323 },
{ "324", N_("channel mode"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_324 },
- { "329", "???", "", "",
- NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_329 },
+ { "326", N_("whois (has oper privs)"), "", "",
+ NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_whois_nick_msg },
{ "331", N_("no topic for channel"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_331 },
{ "332", N_("topic of channel"),
diff --git a/src/irc/irc-recv.c b/src/irc/irc-recv.c
index cfded7e10..cb6744007 100644
--- a/src/irc/irc-recv.c
+++ b/src/irc/irc-recv.c
@@ -2693,11 +2693,11 @@ irc_cmd_recv_306 (t_irc_server *server, char *host, char *nick, char *arguments)
}
/*
- * irc_cmd_recv_307: '307' command (whois, registered nick)
+ * irc_cmd_recv_whois_nick_msg: a whois command with nick and message
*/
int
-irc_cmd_recv_307 (t_irc_server *server, char *host, char *nick, char *arguments)
+irc_cmd_recv_whois_nick_msg (t_irc_server *server, char *host, char *nick, char *arguments)
{
char *pos_nick, *pos_msg;
@@ -2737,6 +2737,39 @@ irc_cmd_recv_307 (t_irc_server *server, char *host, char *nick, char *arguments)
}
/*
+ * irc_cmd_recv_310: '310' command (whois, help mode)
+ */
+
+int
+irc_cmd_recv_310 (t_irc_server *server, char *host, char *nick, char *arguments)
+{
+ char *pos_nick;
+
+ /* make gcc happy */
+ (void) host;
+ (void) nick;
+
+ if (!command_ignored)
+ {
+ pos_nick = strchr (arguments, ' ');
+ if (pos_nick)
+ {
+ while (pos_nick[0] == ' ')
+ pos_nick++;
+
+ irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ gui_printf (server->buffer, _("%s[%s%s%s]%s help mode (+h)\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));
+ }
+ }
+ return 0;
+}
+
+/*
* irc_cmd_recv_311: '311' command (whois, user)
*/
@@ -2863,50 +2896,6 @@ irc_cmd_recv_312 (t_irc_server *server, char *host, char *nick, char *arguments)
}
/*
- * irc_cmd_recv_313: '313' command (whois, operator)
- */
-
-int
-irc_cmd_recv_313 (t_irc_server *server, char *host, char *nick, char *arguments)
-{
- char *pos_nick, *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_message = strchr (pos_nick, ' ');
- 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\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),
- pos_message);
- }
- }
- }
- return 0;
-}
-
-/*
* irc_cmd_recv_314: '314' command (whowas)
*/
@@ -3120,51 +3109,7 @@ irc_cmd_recv_317 (t_irc_server *server, char *host, char *nick, char *arguments)
}
/*
- * irc_cmd_recv_318: '318' command (whois, end)
- */
-
-int
-irc_cmd_recv_318 (t_irc_server *server, char *host, char *nick, char *arguments)
-{
- char *pos_nick, *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_message = strchr (pos_nick, ' ');
- 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\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),
- pos_message);
- }
- }
- }
- return 0;
-}
-
-/*
- * irc_cmd_recv_319: '319' command (whois, end)
+ * irc_cmd_recv_319: '319' command (whois, channels)
*/
int
@@ -3245,50 +3190,6 @@ irc_cmd_recv_319 (t_irc_server *server, char *host, char *nick, char *arguments)
}
/*
- * irc_cmd_recv_320: '320' command (whois, identified user)
- */
-
-int
-irc_cmd_recv_320 (t_irc_server *server, char *host, char *nick, char *arguments)
-{
- char *pos_nick, *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_message = strchr (pos_nick, ' ');
- 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\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),
- pos_message);
- }
- }
- }
- return 0;
-}
-
-/*
* irc_cmd_recv_321: '321' command (/list start)
*/
@@ -3461,22 +3362,6 @@ irc_cmd_recv_324 (t_irc_server *server, char *host, char *nick, char *arguments)
}
/*
- * irc_cmd_recv_329: '329' command (???)
- */
-
-int
-irc_cmd_recv_329 (t_irc_server *server, char *host, char *nick, char *arguments)
-{
- /* make gcc happy */
- (void) server;
- (void) host;
- (void) nick;
- (void) arguments;
-
- return 0;
-}
-
-/*
* irc_cmd_recv_331: '331' command received (no topic for channel)
*/
diff --git a/src/irc/irc.h b/src/irc/irc.h
index 328d4a5b6..1c356b410 100644
--- a/src/irc/irc.h
+++ b/src/irc/irc.h
@@ -531,21 +531,18 @@ extern int irc_cmd_recv_302 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_303 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_305 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_306 (t_irc_server *, char *, char *, char *);
-extern int irc_cmd_recv_307 (t_irc_server *, char *, char *, char *);
+extern int irc_cmd_recv_whois_nick_msg (t_irc_server *, char *, char *, char *);
+extern int irc_cmd_recv_310 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_311 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_312 (t_irc_server *, char *, char *, char *);
-extern int irc_cmd_recv_313 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_314 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_315 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_317 (t_irc_server *, char *, char *, char *);
-extern int irc_cmd_recv_318 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_319 (t_irc_server *, char *, char *, char *);
-extern int irc_cmd_recv_320 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_321 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_322 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_323 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_324 (t_irc_server *, char *, char *, char *);
-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 *);