diff options
Diffstat (limited to 'src/fe-common/irc/fe-events-numeric.c')
-rw-r--r-- | src/fe-common/irc/fe-events-numeric.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/fe-common/irc/fe-events-numeric.c b/src/fe-common/irc/fe-events-numeric.c index 0510c4ff..1de8e5dd 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" @@ -105,7 +106,7 @@ static void event_end_of_names(IRC_SERVER_REC *server, const char *data, static void event_who(IRC_SERVER_REC *server, const char *data) { char *params, *nick, *channel, *user, *host, *stat, *realname, *hops; - char *serv; + char *serv, *recoded; g_return_if_fail(data != NULL); @@ -118,10 +119,12 @@ static void event_who(IRC_SERVER_REC *server, const char *data) if (*realname == ' ') *realname++ = '\0'; + recoded = recode_in(SERVER(server), realname, nick); printformat(server, NULL, MSGLEVEL_CRAP, IRCTXT_WHO, - channel, nick, stat, hops, user, host, realname, serv); + channel, nick, stat, hops, user, host, recoded, serv); g_free(params); + g_free(recoded); } static void event_end_of_who(IRC_SERVER_REC *server, const char *data) @@ -245,15 +248,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(SERVER(server), 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) @@ -323,11 +328,12 @@ static void event_unaway(IRC_SERVER_REC *server, const char *data) static void event_away(IRC_SERVER_REC *server, const char *data) { - char *params, *nick, *awaymsg; + char *params, *nick, *awaymsg, *recoded; g_return_if_fail(data != NULL); params = event_get_params(data, 3, NULL, &nick, &awaymsg); + recoded = recode_in(SERVER(server), awaymsg, nick); if (!settings_get_bool("show_away_once") || last_away_nick == NULL || g_strcasecmp(last_away_nick, nick) != 0 || last_away_msg == NULL || g_strcasecmp(last_away_msg, awaymsg) != 0) { @@ -339,9 +345,10 @@ static void event_away(IRC_SERVER_REC *server, const char *data) last_away_msg = g_strdup(awaymsg); printformat(server, nick, MSGLEVEL_CRAP, - IRCTXT_NICK_AWAY, nick, awaymsg); + IRCTXT_NICK_AWAY, nick, recoded); } g_free(params); + g_free(recoded); } static void event_userhost(IRC_SERVER_REC *server, const char *data) @@ -541,7 +548,7 @@ static void event_numeric(IRC_SERVER_REC *server, const char *data, static void print_event_received(IRC_SERVER_REC *server, const char *data, const char *nick, int target_param) { - char *target, *args, *ptr, *ptr2; + char *target, *args, *ptr, *ptr2, *recoded; int format; g_return_if_fail(data != NULL); @@ -570,12 +577,14 @@ static void print_event_received(IRC_SERVER_REC *server, const char *data, g_memmove(ptr+1, ptr+2, strlen(ptr+1)); } + recoded = recode_in(SERVER(server), args, NULL); format = nick == NULL || server->real_address == NULL || strcmp(nick, server->real_address) == 0 ? IRCTXT_DEFAULT_EVENT : IRCTXT_DEFAULT_EVENT_SERVER; printformat(server, target, MSGLEVEL_CRAP, format, - nick, args, current_server_event); + nick, recoded, current_server_event); + g_free(recoded); g_free(args); g_free(target); } |