diff options
Diffstat (limited to 'src/fe-common/irc/fe-events.c')
-rw-r--r-- | src/fe-common/irc/fe-events.c | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/src/fe-common/irc/fe-events.c b/src/fe-common/irc/fe-events.c index dc952a66..f5d03cf5 100644 --- a/src/fe-common/irc/fe-events.c +++ b/src/fe-common/irc/fe-events.c @@ -30,6 +30,7 @@ #include "servers-reconnect.h" #include "queries.h" #include "ignore.h" +#include "recode.h" #include "irc-servers.h" #include "irc-channels.h" @@ -44,7 +45,7 @@ static void event_privmsg(IRC_SERVER_REC *server, const char *data, const char *nick, const char *addr) { - char *params, *target, *msg; + char *params, *target, *msg, *recoded; g_return_if_fail(data != NULL); @@ -53,46 +54,55 @@ static void event_privmsg(IRC_SERVER_REC *server, const char *data, if (addr == NULL) addr = ""; if (*target == '@' && ischannel(target[1])) { /* Hybrid 6 feature, send msg to all ops in channel */ + recoded = recode_in(SERVER(server), msg, target+1); signal_emit("message irc op_public", 5, - server, msg, nick, addr, + server, recoded, nick, addr, get_visible_target(server, target+1)); } else { + recoded = recode_in(SERVER(server), msg, ischannel(*target) ? target : nick); signal_emit(ischannel(*target) ? "message public" : "message private", 5, - server, msg, nick, addr, + server, recoded, nick, addr, get_visible_target(server, target)); } g_free(params); + g_free(recoded); } static void ctcp_action(IRC_SERVER_REC *server, const char *data, const char *nick, const char *addr, const char *target) { + char *recoded; + g_return_if_fail(data != NULL); + recoded = recode_in(SERVER(server), data, target); signal_emit("message irc action", 5, - server, data, nick, addr, + server, recoded, nick, addr, get_visible_target(server, target)); + g_free(recoded); } static void event_notice(IRC_SERVER_REC *server, const char *data, const char *nick, const char *addr) { - char *params, *target, *msg; + char *params, *target, *msg, *recoded; g_return_if_fail(data != NULL); params = event_get_params(data, 2 | PARAM_FLAG_GETREST, &target, &msg); + recoded = recode_in(SERVER(server), msg, target); if (nick == NULL) { nick = server->real_address == NULL ? server->connrec->address : server->real_address; } - signal_emit("message irc notice", 5, server, msg, nick, addr, + signal_emit("message irc notice", 5, server, recoded, nick, addr, get_visible_target(server, target)); g_free(params); + g_free(recoded); } static void event_join(IRC_SERVER_REC *server, const char *data, @@ -114,15 +124,17 @@ static void event_join(IRC_SERVER_REC *server, const char *data, static void event_part(IRC_SERVER_REC *server, const char *data, const char *nick, const char *addr) { - char *params, *channel, *reason; + char *params, *channel, *reason, *recoded; g_return_if_fail(data != NULL); params = event_get_params(data, 2 | PARAM_FLAG_GETREST, &channel, &reason); + recoded = recode_in(SERVER(server), reason, channel); signal_emit("message part", 5, server, - get_visible_target(server, channel), nick, addr, reason); + get_visible_target(server, channel), nick, addr, recoded); g_free(params); + g_free(recoded); } static void event_quit(IRC_SERVER_REC *server, const char *data, @@ -137,16 +149,18 @@ static void event_quit(IRC_SERVER_REC *server, const char *data, static void event_kick(IRC_SERVER_REC *server, const char *data, const char *kicker, const char *addr) { - char *params, *channel, *nick, *reason; + char *params, *channel, *nick, *reason, *recoded; g_return_if_fail(data != NULL); params = event_get_params(data, 3 | PARAM_FLAG_GETREST, &channel, &nick, &reason); + recoded = recode_in(SERVER(server), reason, channel); signal_emit("message kick", 6, server, get_visible_target(server, channel), - nick, kicker, addr, reason); + nick, kicker, addr, recoded); g_free(params); + g_free(recoded); } static void event_kill(IRC_SERVER_REC *server, const char *data, @@ -242,15 +256,17 @@ static void event_invite(IRC_SERVER_REC *server, const char *data, static void event_topic(IRC_SERVER_REC *server, const char *data, const char *nick, const char *addr) { - char *params, *channel, *topic; + char *params, *channel, *topic, *recoded; g_return_if_fail(data != NULL); params = event_get_params(data, 2 | PARAM_FLAG_GETREST, &channel, &topic); + recoded = recode_in(SERVER(server), topic, channel); signal_emit("message topic", 5, server, - get_visible_target(server, channel), topic, nick, addr); + get_visible_target(server, channel), recoded, nick, addr); g_free(params); + g_free(recoded); } static void event_error(IRC_SERVER_REC *server, const char *data) |