diff options
author | Emanuele Giaquinta <exg@irssi.org> | 2007-05-05 15:37:58 +0000 |
---|---|---|
committer | exg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2007-05-05 15:37:58 +0000 |
commit | bfc0b362e8f831dd47fec43a0ad18e4b2cfbba34 (patch) | |
tree | 969d5c50235b1247b7430ba5118dfb38a332df87 /src/irc | |
parent | 2a915b21dede9b2ddac8822da7c9697ea8c71bbd (diff) | |
download | irssi-bfc0b362e8f831dd47fec43a0ad18e4b2cfbba34.zip |
Move input recoding in irc_server_event.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4483 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/core/irc.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/irc/core/irc.c b/src/irc/core/irc.c index 528e541f..63324762 100644 --- a/src/irc/core/irc.c +++ b/src/irc/core/irc.c @@ -29,6 +29,7 @@ #include "irc-servers.h" #include "irc-channels.h" #include "servers-redirect.h" +#include "recode.h" char *current_server_event; static int signal_default_event; @@ -281,11 +282,22 @@ static void irc_server_event(IRC_SERVER_REC *server, const char *line, { const char *signal; char *event, *args; + char *params, *target, *recoded_line, *recoded_nick, *recoded_channel; g_return_if_fail(line != NULL); + params = event_get_params(line, 1, &args); + recoded_nick = recode_in(SERVER(server), nick, NULL); + if (ischannel(*args) || + (*args++ == '@' && ischannel(*args))) + target = recoded_channel = recode_in(SERVER(server), args, NULL); + else { + target = recoded_nick; + recoded_channel = NULL; + } + recoded_line = recode_in(SERVER(server), line, target); /* split event / args */ - event = g_strconcat("event ", line, NULL); + event = g_strconcat("event ", recoded_line, NULL); args = strchr(event+6, ' '); if (args != NULL) *args++ = '\0'; else args = ""; while (*args == ' ') args++; @@ -300,11 +312,15 @@ static void irc_server_event(IRC_SERVER_REC *server, const char *line, /* emit it */ current_server_event = event+6; - if (!signal_emit(signal, 4, server, args, nick, address)) - signal_emit_id(signal_default_event, 4, server, line, nick, address); + if (!signal_emit(signal, 4, server, args, recoded_nick, address)) + signal_emit_id(signal_default_event, 4, server, recoded_line, recoded_nick, address); current_server_event = NULL; g_free(event); + g_free(params); + g_free(recoded_line); + g_free(recoded_nick); + g_free(recoded_channel); } /* Read line from server */ |