summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2005-09-10 08:53:35 +0000
committerSebastien Helleu <flashcode@flashtux.org>2005-09-10 08:53:35 +0000
commit2962a8e6c8f05ba3ddca728126fce684dff151f1 (patch)
treeb55c863f435578dc625e9bd42a3d53093e3a9303 /src/irc
parent76263dc7cf7e13ff00fc1a7365733dbae3db53e8 (diff)
downloadweechat-2962a8e6c8f05ba3ddca728126fce684dff151f1.zip
Added IRC commands: 042, 344, 345, 484
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/irc-commands.c5
-rw-r--r--src/irc/irc-recv.c91
-rw-r--r--src/irc/irc.h2
3 files changed, 98 insertions, 0 deletions
diff --git a/src/irc/irc-commands.c b/src/irc/irc-commands.c
index c272bec74..5cfc0e784 100644
--- a/src/irc/irc-commands.c
+++ b/src/irc/irc-commands.c
@@ -300,6 +300,7 @@ t_irc_command irc_commands[] =
{ "004", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_004 },
{ "005", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "020", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
+ { "042", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "212", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "219", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "221", N_("user mode string"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_221 },
@@ -353,6 +354,8 @@ t_irc_command irc_commands[] =
"", "",
0, 0, 1, NULL, NULL, irc_cmd_recv_333 },
{ "341", N_("inviting"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_341 },
+ { "344", N_("channel reop"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_344 },
+ { "345", N_("end of channel reop list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_345 },
{ "351", N_("server version"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_351 },
{ "352", N_("who"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_352 },
{ "353", N_("list of nicks on channel"),
@@ -463,6 +466,8 @@ t_irc_command irc_commands[] =
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "483", N_("you can't kill a server!"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
+ { "484", N_("your connection is restricted!"),
+ "", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "485", N_("user is immune from kick/deop"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "491", N_("no O-lines for your host"),
diff --git a/src/irc/irc-recv.c b/src/irc/irc-recv.c
index 6f1e82e51..91d54dfc5 100644
--- a/src/irc/irc-recv.c
+++ b/src/irc/irc-recv.c
@@ -2897,6 +2897,7 @@ irc_cmd_recv_315 (t_irc_server *server, char *host, char *nick, char *arguments)
}
if (!command_ignored)
{
+ irc_display_prefix (server->buffer, PREFIX_SERVER);
gui_printf_color (server->buffer, COLOR_WIN_CHAT_CHANNEL, "%s", arguments);
gui_printf (server->buffer, " %s\n", pos);
}
@@ -2904,7 +2905,10 @@ irc_cmd_recv_315 (t_irc_server *server, char *host, char *nick, char *arguments)
else
{
if (!command_ignored)
+ {
+ irc_display_prefix (server->buffer, PREFIX_SERVER);
gui_printf (server->buffer, "%s\n", arguments);
+ }
}
return 0;
}
@@ -3630,6 +3634,93 @@ irc_cmd_recv_341 (t_irc_server *server, char *host, char *nick, char *arguments)
}
/*
+ * irc_cmd_recv_344: '344' command (channel reop)
+ */
+
+int
+irc_cmd_recv_344 (t_irc_server *server, char *host, char *nick, char *arguments)
+{
+ char *pos_channel, *pos_host;
+
+ /* make gcc happy */
+ (void) host;
+ (void) nick;
+
+ if (!command_ignored)
+ {
+ pos_channel = strchr (arguments, ' ');
+ if (pos_channel)
+ {
+ while (pos_channel[0] == ' ')
+ pos_channel++;
+ pos_host = strchr (pos_channel, ' ');
+ if (pos_host)
+ {
+ pos_host[0] = '\0';
+ pos_host++;
+ while (pos_host[0] == ' ')
+ pos_host++;
+
+ irc_display_prefix (server->buffer, PREFIX_SERVER);
+ gui_printf_color (server->buffer,
+ COLOR_WIN_CHAT, _("Channel reop"));
+ gui_printf_color (server->buffer,
+ COLOR_WIN_CHAT_CHANNEL, " %s", pos_channel);
+ gui_printf_color (server->buffer,
+ COLOR_WIN_CHAT, ": ");
+ gui_printf_color (server->buffer,
+ COLOR_WIN_CHAT_HOST, "%s\n", pos_host);
+ }
+ }
+ }
+ return 0;
+}
+
+/*
+ * irc_cmd_recv_345: '345' command (end of channel reop)
+ */
+
+int
+irc_cmd_recv_345 (t_irc_server *server, char *host, char *nick, char *arguments)
+{
+ char *pos;
+
+ /* make gcc happy */
+ (void) host;
+ (void) nick;
+
+ /* skip nickname if at beginning of server message */
+ if (strncmp (server->nick, arguments, strlen (server->nick)) == 0)
+ {
+ arguments += strlen (server->nick) + 1;
+ while (arguments[0] == ' ')
+ arguments++;
+ }
+
+ pos = strchr (arguments, ' ');
+ if (pos)
+ {
+ pos[0] = '\0';
+ pos++;
+ if (!command_ignored)
+ {
+ irc_display_prefix (server->buffer, PREFIX_SERVER);
+ gui_printf_color (server->buffer, COLOR_WIN_CHAT_CHANNEL, "%s", arguments);
+ gui_printf (server->buffer, " %s\n", pos);
+ }
+ }
+ else
+ {
+ if (!command_ignored)
+ {
+ irc_display_prefix (server->buffer, PREFIX_SERVER);
+ gui_printf (server->buffer, "%s\n", arguments);
+ }
+ }
+ return 0;
+}
+
+/*
* irc_cmd_recv_351: '351' command received (server version)
*/
diff --git a/src/irc/irc.h b/src/irc/irc.h
index a8f37f7c9..9ddbcb569 100644
--- a/src/irc/irc.h
+++ b/src/irc/irc.h
@@ -484,6 +484,8 @@ 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_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 *);
extern int irc_cmd_recv_351 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_352 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_353 (t_irc_server *, char *, char *, char *);