summaryrefslogtreecommitdiff
path: root/src/fe-common/irc/fe-irc-commands.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-06-04 19:50:16 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-06-04 19:50:16 +0000
commit3609f6f2438f0064968e39739b9f119b0c718605 (patch)
tree4601b5fdf1fa1111c502bae0046bef41bdf739ef /src/fe-common/irc/fe-irc-commands.c
parentf079263035a71e3f97cc7f3c5ebe96ffdba51483 (diff)
downloadirssi-3609f6f2438f0064968e39739b9f119b0c718605.zip
Added support for bahamut @+#channel notices. Removed notice_public_ops
format, notice_public is just fine if the channel just contains @ or @+ at the beginning. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1538 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/irc/fe-irc-commands.c')
-rw-r--r--src/fe-common/irc/fe-irc-commands.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/fe-common/irc/fe-irc-commands.c b/src/fe-common/irc/fe-irc-commands.c
index a2e4829c..7593593d 100644
--- a/src/fe-common/irc/fe-irc-commands.c
+++ b/src/fe-common/irc/fe-irc-commands.c
@@ -40,6 +40,19 @@
#include "printtext.h"
#include "keyboard.h"
+static char *skip_target(char *target)
+{
+ if (*target == '@') {
+ /* @#channel, @+#channel - Hybrid6 / Bahamut features */
+ if (target[1] == '+' && ischannel(target[2]))
+ target += 2;
+ else if (ischannel(target[1]))
+ target++;
+ }
+
+ return target;
+}
+
/* SYNTAX: ME <message> */
static void cmd_me(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item)
{
@@ -75,6 +88,7 @@ static void cmd_action(const char *data, IRC_SERVER_REC *server)
signal_emit("message irc own_action", 3, server, text, target);
+ target = skip_target(target);
irc_send_cmdv(server, "PRIVMSG %s :\001ACTION %s\001", target, text);
cmd_params_free(free_arg);
}
@@ -94,11 +108,7 @@ static void cmd_notice(const char *data, IRC_SERVER_REC *server)
if (*target == '\0' || *msg == '\0')
cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
- if (*target == '@' && ischannel(target[1])) {
- /* Hybrid 6 feature, send notice to all ops in channel */
- target++;
- }
-
+ target = skip_target(target);
signal_emit("message irc own_notice", 3, server, msg, target);
cmd_params_free(free_arg);
}
@@ -124,10 +134,7 @@ static void cmd_ctcp(const char *data, IRC_SERVER_REC *server)
return;
}
- if (*target == '@' && ischannel(target[1])) {
- /* Hybrid 6 feature, send ctcp to all ops in channel */
- target++;
- }
+ target = skip_target(target);
g_strup(ctcpcmd);
signal_emit("message irc own_ctcp", 4,
@@ -151,11 +158,7 @@ static void cmd_nctcp(const char *data, IRC_SERVER_REC *server)
if (*target == '\0' || *text == '\0')
cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
- if (*target == '@' && ischannel(target[1])) {
- /* Hybrid 6 feature, send notice to all ops in channel */
- target++;
- }
-
+ target = skip_target(target);
signal_emit("message irc own_notice", 3, server, text, target);
cmd_params_free(free_arg);
}