diff options
-rw-r--r-- | src/fe-common/irc/fe-irc-channels.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/fe-common/irc/fe-irc-channels.c b/src/fe-common/irc/fe-irc-channels.c index 853fe587..67277191 100644 --- a/src/fe-common/irc/fe-irc-channels.c +++ b/src/fe-common/irc/fe-irc-channels.c @@ -23,9 +23,12 @@ #include "signals.h" #include "levels.h" +#include "irc-channels.h" #include "channel-rejoin.h" #include "printtext.h" +#include "fe-windows.h" +#include "window-items.h" static void sig_channel_rejoin(SERVER_REC *server, REJOIN_REC *rec) { @@ -35,12 +38,28 @@ static void sig_channel_rejoin(SERVER_REC *server, REJOIN_REC *rec) IRCTXT_CHANNEL_REJOIN, rec->channel); } +static void sig_event_forward(SERVER_REC *server, const char *data) +{ + IRC_CHANNEL_REC *channel; + char *params, *from, *to; + + params = event_get_params(data, 3, NULL, &from, &to); + channel = irc_channel_find(server, from); + if (channel != NULL) { + window_bind_add(window_item_window(channel), + server->tag, to); + } + g_free(params); +} + void fe_irc_channels_init(void) { signal_add("channel rejoin new", (SIGNAL_FUNC) sig_channel_rejoin); + signal_add_first("event 379", (SIGNAL_FUNC) sig_event_forward); } void fe_irc_channels_deinit(void) { signal_remove("channel rejoin new", (SIGNAL_FUNC) sig_channel_rejoin); + signal_remove("event 379", (SIGNAL_FUNC) sig_event_forward); } |