diff options
author | Jilles Tjoelker <jilles@irssi.org> | 2007-07-08 16:44:35 +0000 |
---|---|---|
committer | jilles <jilles@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2007-07-08 16:44:35 +0000 |
commit | 3b72b51257803ec7cfd87e4120ac04823d9c6fd9 (patch) | |
tree | cab255a44556cdebe15d84c6b2b56d4134ed5371 /src/fe-common/irc/fe-irc-channels.c | |
parent | 131d92c4d36fb7d0a89150c65ea87f5274876c26 (diff) | |
download | irssi-3b72b51257803ec7cfd87e4120ac04823d9c6fd9.zip |
Update channel forwarding code.
This is now on numeric 470 instead of 379.
It works with hyperion and charybdis, and puts the
channel you were forwarded to in the window the original
channel would be in.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4575 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/irc/fe-irc-channels.c')
-rw-r--r-- | src/fe-common/irc/fe-irc-channels.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/fe-common/irc/fe-irc-channels.c b/src/fe-common/irc/fe-irc-channels.c index 56efe9dd..e884aef4 100644 --- a/src/fe-common/irc/fe-irc-channels.c +++ b/src/fe-common/irc/fe-irc-channels.c @@ -39,16 +39,19 @@ 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) +static void sig_event_forward(SERVER_REC *server, const char *data, + const char *nick) { 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); + if (from != NULL && to != NULL && ischannel(*from) && ischannel(*to)) { + channel = irc_channel_find(server, from); + if (channel != NULL && irc_channel_find(server, to) == NULL) { + window_bind_add(window_item_window(channel), + server->tag, to); + } } g_free(params); } @@ -56,11 +59,11 @@ static void sig_event_forward(SERVER_REC *server, const char *data) 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); + signal_add_first("event 470", (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); + signal_remove("event 470", (SIGNAL_FUNC) sig_event_forward); } |