summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/irc/irc-commands.c6
-rw-r--r--src/irc/irc-send.c41
-rw-r--r--src/irc/irc.h1
3 files changed, 47 insertions, 1 deletions
diff --git a/src/irc/irc-commands.c b/src/irc/irc-commands.c
index 5cfc0e784..9f8ac9fe5 100644
--- a/src/irc/irc-commands.c
+++ b/src/irc/irc-commands.c
@@ -35,6 +35,10 @@ t_irc_command irc_commands[] =
N_("[target]"),
N_("target: server"),
0, 1, 1, NULL, irc_cmd_send_admin, NULL },
+ { "ame", N_("send a CTCP action to all channels of all connected servers"),
+ N_("message"),
+ N_("message: message to send"),
+ 1, MAX_ARGS, 1, NULL, irc_cmd_send_ame, NULL },
{ "amsg", N_("send message to all channels of all connected servers"),
N_("text"),
N_("text: text to send"),
@@ -126,7 +130,7 @@ t_irc_command irc_commands[] =
N_("mask: servers matching the mask only\n"
"target: server for forwarding request"),
0, 2, 1, NULL, irc_cmd_send_lusers, NULL },
- { "me", N_("send a ctcp action to the current channel"),
+ { "me", N_("send a CTCP action to the current channel"),
N_("message"),
N_("message: message to send"),
0, MAX_ARGS, 1, NULL, irc_cmd_send_me, NULL },
diff --git a/src/irc/irc-send.c b/src/irc/irc-send.c
index 854e73311..9e8e2e0ab 100644
--- a/src/irc/irc-send.c
+++ b/src/irc/irc-send.c
@@ -83,6 +83,47 @@ irc_cmd_send_admin (t_irc_server *server, char *arguments)
}
/*
+ * irc_cmd_send_ame: send a ctcp action to all channels of all connected servers
+ */
+
+int
+irc_cmd_send_ame (t_irc_server *server, char *arguments)
+{
+ t_irc_server *ptr_server;
+ t_irc_channel *ptr_channel;
+
+ /* make gcc happy */
+ (void) server;
+
+ gui_add_hotlist = 0;
+ for (ptr_server = irc_servers; ptr_server;
+ ptr_server = ptr_server->next_server)
+ {
+ if (ptr_server->is_connected)
+ {
+ for (ptr_channel = ptr_server->channels; ptr_channel;
+ ptr_channel = ptr_channel->next_channel)
+ {
+ if (ptr_channel->type == CHAT_CHANNEL)
+ {
+ server_sendf (ptr_server, "PRIVMSG %s :\01ACTION %s\01\r\n",
+ ptr_channel->name,
+ (arguments && arguments[0]) ? arguments : "");
+ irc_display_prefix (ptr_channel->buffer, PREFIX_ACTION_ME);
+ gui_printf_color (ptr_channel->buffer,
+ COLOR_WIN_CHAT_NICK, "%s", ptr_server->nick);
+ gui_printf_color (ptr_channel->buffer,
+ COLOR_WIN_CHAT, " %s\n",
+ (arguments && arguments[0]) ? arguments : "");
+ }
+ }
+ }
+ }
+ gui_add_hotlist = 1;
+ return 0;
+}
+
+/*
* irc_cmd_send_amsg: send message to all channels of all connected servers
*/
diff --git a/src/irc/irc.h b/src/irc/irc.h
index 51696b5fd..2e3df2f70 100644
--- a/src/irc/irc.h
+++ b/src/irc/irc.h
@@ -384,6 +384,7 @@ extern int irc_recv_command (t_irc_server *, char *, char *, char *, char *);
extern void irc_login (t_irc_server *);
/* IRC commands issued by user */
extern int irc_cmd_send_admin (t_irc_server *, char *);
+extern int irc_cmd_send_ame (t_irc_server *, char *);
extern int irc_cmd_send_amsg (t_irc_server *, char *);
extern int irc_cmd_send_away (t_irc_server *, char *);
extern int irc_cmd_send_ban (t_irc_server *, char *);