2000-09-02 14:53:58 -04:00
|
|
|
/*
|
|
|
|
fe-irc-channels.c : irssi
|
|
|
|
|
|
|
|
Copyright (C) 1999-2000 Timo Sirainen
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "module.h"
|
2000-10-13 20:45:16 -04:00
|
|
|
#include "module-formats.h"
|
2000-09-02 14:53:58 -04:00
|
|
|
#include "signals.h"
|
2000-10-13 20:45:16 -04:00
|
|
|
#include "levels.h"
|
2000-09-02 14:53:58 -04:00
|
|
|
|
2001-12-19 21:14:49 -05:00
|
|
|
#include "irc-servers.h"
|
2001-12-09 12:13:10 -05:00
|
|
|
#include "irc-channels.h"
|
2000-10-13 20:45:16 -04:00
|
|
|
#include "channel-rejoin.h"
|
|
|
|
|
2000-10-28 16:14:19 -04:00
|
|
|
#include "printtext.h"
|
2001-12-09 12:13:10 -05:00
|
|
|
#include "fe-windows.h"
|
|
|
|
#include "window-items.h"
|
2000-10-28 16:14:19 -04:00
|
|
|
|
2001-11-01 20:05:14 -05:00
|
|
|
static void sig_channel_rejoin(SERVER_REC *server, REJOIN_REC *rec)
|
2000-10-13 20:45:16 -04:00
|
|
|
{
|
|
|
|
g_return_if_fail(rec != NULL);
|
|
|
|
|
|
|
|
printformat(server, NULL, MSGLEVEL_CLIENTNOTICE,
|
|
|
|
IRCTXT_CHANNEL_REJOIN, rec->channel);
|
|
|
|
}
|
2000-09-02 14:53:58 -04:00
|
|
|
|
2001-12-09 12:13:10 -05:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2000-09-02 14:53:58 -04:00
|
|
|
void fe_irc_channels_init(void)
|
|
|
|
{
|
2000-10-13 20:45:16 -04:00
|
|
|
signal_add("channel rejoin new", (SIGNAL_FUNC) sig_channel_rejoin);
|
2001-12-09 12:13:10 -05:00
|
|
|
signal_add_first("event 379", (SIGNAL_FUNC) sig_event_forward);
|
2000-09-02 14:53:58 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void fe_irc_channels_deinit(void)
|
|
|
|
{
|
2000-10-13 20:45:16 -04:00
|
|
|
signal_remove("channel rejoin new", (SIGNAL_FUNC) sig_channel_rejoin);
|
2001-12-09 12:13:10 -05:00
|
|
|
signal_remove("event 379", (SIGNAL_FUNC) sig_event_forward);
|
2000-09-02 14:53:58 -04:00
|
|
|
}
|