2 silc-servers-reconnect.c : irssi
4 Copyright (C) 2000 Timo Sirainen
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include "silc-servers.h"
26 static void sig_server_reconnect_save_status(SILC_SERVER_CONNECT_REC *conn,
27 SILC_SERVER_REC *server)
29 if (!IS_SILC_SERVER_CONNECT(conn) || !IS_SILC_SERVER(server))
32 g_free_not_null(conn->channels);
33 conn->channels = silc_server_get_channels(server);
36 static void sig_server_connect_copy(SERVER_CONNECT_REC **dest,
37 SILC_SERVER_CONNECT_REC *src)
39 SILC_SERVER_CONNECT_REC *rec;
41 g_return_if_fail(dest != NULL);
42 if (!IS_SILC_SERVER_CONNECT(src))
45 rec = g_new0(SILC_SERVER_CONNECT_REC, 1);
46 rec->chat_type = SILC_PROTOCOL;
47 *dest = (SERVER_CONNECT_REC *) rec;
50 void silc_servers_reconnect_init(void)
52 signal_add("server reconnect save status", (SIGNAL_FUNC) sig_server_reconnect_save_status);
53 signal_add("server connect copy", (SIGNAL_FUNC) sig_server_connect_copy);
56 void silc_servers_reconnect_deinit(void)
58 signal_remove("server reconnect save status", (SIGNAL_FUNC) sig_server_reconnect_save_status);
59 signal_remove("server connect copy", (SIGNAL_FUNC) sig_server_connect_copy);