1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-29 04:45:57 -04:00

Support for OPN's channel forwarding.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2227 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-12-09 17:13:10 +00:00 committed by cras
parent e8696c711e
commit a8419ed5b9

View File

@ -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);
}