diff options
author | Valentin Batz <senneth@irssi.org> | 2005-10-15 18:45:25 +0000 |
---|---|---|
committer | vb <vb@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2005-10-15 18:45:25 +0000 |
commit | 4a7107437d7d8d6c23a3a7c133c3adac588bec1c (patch) | |
tree | a07d30694da31aae1247e264f891d0038f17b2de /src/fe-common/irc | |
parent | 674eec8fd2625c4e87ef87fd554b2c5a9bdfedb4 (diff) | |
download | irssi-4a7107437d7d8d6c23a3a7c133c3adac588bec1c.zip |
fixed recode for actions and added recode for numeric events
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4041 dbcabf3a-b0e7-0310-adc4-f8d773084564
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-irc-messages.c | 27 |
2 files changed, 22 insertions, 12 deletions
diff --git a/src/fe-common/irc/fe-events-numeric.c b/src/fe-common/irc/fe-events-numeric.c index 0820820b..f8e2d102 100644 --- a/src/fe-common/irc/fe-events-numeric.c +++ b/src/fe-common/irc/fe-events-numeric.c @@ -505,7 +505,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; + char *target, *args, *ptr, *recoded; int format; g_return_if_fail(data != NULL); @@ -540,11 +540,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); } diff --git a/src/fe-common/irc/fe-irc-messages.c b/src/fe-common/irc/fe-irc-messages.c index 6e14e8e5..538eb8ec 100644 --- a/src/fe-common/irc/fe-irc-messages.c +++ b/src/fe-common/irc/fe-irc-messages.c @@ -147,7 +147,7 @@ static void sig_message_irc_action(IRC_SERVER_REC *server, const char *msg, const char *target) { void *item; - char *freemsg = NULL; + char *freemsg = NULL, *recoded; int level; level = MSGLEVEL_ACTIONS | @@ -164,27 +164,29 @@ static void sig_message_irc_action(IRC_SERVER_REC *server, const char *msg, if (settings_get_bool("emphasis")) msg = freemsg = expand_emphasis(item, msg); + recoded = recode_in(SERVER(server), msg, target); if (ischannel(*target)) { /* channel action */ if (window_item_is_active(item)) { /* message to active channel in window */ printformat(server, target, level, - IRCTXT_ACTION_PUBLIC, nick, msg); + IRCTXT_ACTION_PUBLIC, nick, recoded); } else { /* message to not existing/active channel */ printformat(server, target, level, IRCTXT_ACTION_PUBLIC_CHANNEL, - nick, target, msg); + nick, target, recoded); } } else { /* private action */ printformat(server, nick, MSGLEVEL_ACTIONS | MSGLEVEL_MSGS, item == NULL ? IRCTXT_ACTION_PRIVATE : IRCTXT_ACTION_PRIVATE_QUERY, - nick, address == NULL ? "" : address, msg); + nick, address == NULL ? "" : address, recoded); } - - g_free_not_null(freemsg); + + g_free(recoded); + g_free_not_null(freemsg); } static void sig_message_own_notice(IRC_SERVER_REC *server, const char *msg, @@ -203,17 +205,20 @@ static void sig_message_irc_notice(SERVER_REC *server, const char *msg, const char *target) { const char *oldtarget; - + char *recoded; + oldtarget = target; target = skip_target(target); if (address == NULL || *address == '\0') { /* notice from server */ + recoded = recode_in(SERVER(server), msg, NULL); if (!ignore_check(server, nick, "", target, msg, MSGLEVEL_SNOTES)) { printformat(server, target, MSGLEVEL_SNOTES, IRCTXT_NOTICE_SERVER, nick, msg); } + g_free(recoded); return; } @@ -222,17 +227,19 @@ static void sig_message_irc_notice(SERVER_REC *server, const char *msg, msg, MSGLEVEL_NOTICES)) return; - if (ischannel(*target)) { + recoded = recode_in(SERVER(server), msg, target); + if (ischannel(*target)) { /* notice in some channel */ printformat(server, target, MSGLEVEL_NOTICES, - IRCTXT_NOTICE_PUBLIC, nick, oldtarget, msg); + IRCTXT_NOTICE_PUBLIC, nick, oldtarget, recoded); } else { /* private notice */ privmsg_get_query(SERVER(server), nick, FALSE, MSGLEVEL_NOTICES); printformat(server, nick, MSGLEVEL_NOTICES, - IRCTXT_NOTICE_PRIVATE, nick, address, msg); + IRCTXT_NOTICE_PRIVATE, nick, address, recoded); } + g_free(recoded); } static void sig_message_own_ctcp(IRC_SERVER_REC *server, const char *cmd, |