diff options
Diffstat (limited to 'src/fe-common/irc')
-rw-r--r-- | src/fe-common/irc/fe-events-numeric.c | 7 | ||||
-rw-r--r-- | src/fe-common/irc/fe-events.c | 41 |
2 files changed, 32 insertions, 16 deletions
diff --git a/src/fe-common/irc/fe-events-numeric.c b/src/fe-common/irc/fe-events-numeric.c index 6dcf8eee..f67cd844 100644 --- a/src/fe-common/irc/fe-events-numeric.c +++ b/src/fe-common/irc/fe-events-numeric.c @@ -24,6 +24,7 @@ #include "misc.h" #include "settings.h" #include "levels.h" +#include "recode.h" #include "irc-servers.h" #include "irc-channels.h" @@ -228,15 +229,17 @@ static void event_nick_in_use(IRC_SERVER_REC *server, const char *data) static void event_topic_get(IRC_SERVER_REC *server, const char *data) { const char *channel; - char *params, *topic; + char *params, *topic, *recoded; g_return_if_fail(data != NULL); params = event_get_params(data, 3, NULL, &channel, &topic); + recoded = recode_in(topic, channel); channel = get_visible_target(server, channel); printformat(server, channel, MSGLEVEL_CRAP, - IRCTXT_TOPIC, channel, topic); + IRCTXT_TOPIC, channel, recoded); g_free(params); + g_free(recoded); } static void event_topic_info(IRC_SERVER_REC *server, const char *data) diff --git a/src/fe-common/irc/fe-events.c b/src/fe-common/irc/fe-events.c index 90be755e..6e157caa 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,57 +45,63 @@ 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); params = event_get_params(data, 2 | PARAM_FLAG_GETREST, &target, &msg); if (nick == NULL) nick = server->real_address; if (addr == NULL) addr = ""; - + recoded = recode_in(msg, target); if (*target == '@' && ischannel(target[1])) { /* Hybrid 6 feature, send msg to all ops in channel */ signal_emit("message irc op_public", 5, - server, msg, nick, addr, + server, recoded, nick, addr, get_visible_target(server, target+1)); } else { 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) { - g_return_if_fail(data != NULL); + char *recoded; + g_return_if_fail(data != NULL); + recoded = recode_in(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(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, @@ -116,15 +123,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(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, @@ -139,16 +148,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(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, @@ -244,15 +255,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(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) |