mirror of
https://github.com/irssi/irssi.git
synced 2024-09-08 04:26:01 -04:00
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
This commit is contained in:
parent
131d92c4d3
commit
3b72b51257
@ -666,6 +666,7 @@ void fe_events_numeric_init(void)
|
||||
signal_add("event 438", (SIGNAL_FUNC) event_received);
|
||||
signal_add("event 465", (SIGNAL_FUNC) event_received);
|
||||
signal_add("event 439", (SIGNAL_FUNC) event_received);
|
||||
signal_add("event 470", (SIGNAL_FUNC) event_received);
|
||||
signal_add("event 479", (SIGNAL_FUNC) event_received);
|
||||
|
||||
signal_add("event 344", (SIGNAL_FUNC) event_target_received); /* reop list */
|
||||
@ -751,6 +752,7 @@ void fe_events_numeric_deinit(void)
|
||||
signal_remove("event 438", (SIGNAL_FUNC) event_received);
|
||||
signal_remove("event 465", (SIGNAL_FUNC) event_received);
|
||||
signal_remove("event 439", (SIGNAL_FUNC) event_received);
|
||||
signal_remove("event 470", (SIGNAL_FUNC) event_received);
|
||||
signal_remove("event 479", (SIGNAL_FUNC) event_received);
|
||||
|
||||
signal_remove("event 344", (SIGNAL_FUNC) event_target_received);
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user