mirror of
https://github.com/irssi/irssi.git
synced 2024-09-01 04:14:16 -04:00
Bugfixes for non-irc server handling.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@550 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
05cfbaf9d5
commit
87a8f71344
@ -229,6 +229,8 @@ void server_disconnect(SERVER_REC *server)
|
||||
|
||||
if (server->handle != NULL)
|
||||
net_sendbuffer_destroy(server->handle, TRUE);
|
||||
if (server->readtag > 0)
|
||||
g_source_remove(server->readtag);
|
||||
|
||||
MODULE_DATA_DEINIT(server);
|
||||
rawlog_destroy(server->rawlog);
|
||||
|
@ -574,6 +574,9 @@ static void completion_deinit_server(IRC_SERVER_REC *server)
|
||||
{
|
||||
g_return_if_fail(server != NULL);
|
||||
|
||||
if (!irc_server_check(server))
|
||||
return;
|
||||
|
||||
g_slist_foreach(server->lastmsgs, (GFunc) g_free, NULL);
|
||||
g_slist_free(server->lastmsgs);
|
||||
}
|
||||
|
@ -59,6 +59,9 @@ static void event_target_unavailable(const char *data, IRC_SERVER_REC *server)
|
||||
|
||||
static void sig_disconnected(IRC_SERVER_REC *server)
|
||||
{
|
||||
if (!irc_server_check(server))
|
||||
return;
|
||||
|
||||
g_slist_foreach(server->rejoin_channels, (GFunc) g_free, NULL);
|
||||
g_slist_free(server->rejoin_channels);
|
||||
}
|
||||
|
@ -73,7 +73,8 @@ static void sig_connected(IRC_SERVER_REC *server)
|
||||
SERVER_QUERY_REC *rec;
|
||||
|
||||
g_return_if_fail(server != NULL);
|
||||
if (!irc_server_check(server)) return;
|
||||
if (!irc_server_check(server))
|
||||
return;
|
||||
|
||||
rec = g_new0(SERVER_QUERY_REC, 1);
|
||||
server->chanqueries = rec;
|
||||
@ -85,7 +86,8 @@ static void sig_disconnected(IRC_SERVER_REC *server)
|
||||
int n;
|
||||
|
||||
g_return_if_fail(server != NULL);
|
||||
if (!irc_server_check(server)) return;
|
||||
if (!irc_server_check(server))
|
||||
return;
|
||||
|
||||
rec = server->chanqueries;
|
||||
g_return_if_fail(rec != NULL);
|
||||
|
@ -182,10 +182,13 @@ static void event_notice(const char *data, IRC_SERVER_REC *server, const char *n
|
||||
g_free(params);
|
||||
}
|
||||
|
||||
static void ctcp_deinit_server(IRC_SERVER_REC *server)
|
||||
static void sig_disconnected(IRC_SERVER_REC *server)
|
||||
{
|
||||
g_return_if_fail(server != NULL);
|
||||
|
||||
if (!irc_server_check(server))
|
||||
return;
|
||||
|
||||
g_slist_free(server->ctcpqueue);
|
||||
}
|
||||
|
||||
@ -194,7 +197,7 @@ void ctcp_init(void)
|
||||
settings_add_str("misc", "ctcp_version_reply", PACKAGE" v$J - running on $sysname");
|
||||
settings_add_int("flood", "max_ctcp_queue", 5);
|
||||
|
||||
signal_add("server disconnected", (SIGNAL_FUNC) ctcp_deinit_server);
|
||||
signal_add("server disconnected", (SIGNAL_FUNC) sig_disconnected);
|
||||
signal_add_first("event privmsg", (SIGNAL_FUNC) event_privmsg);
|
||||
signal_add_first("event notice", (SIGNAL_FUNC) event_notice);
|
||||
signal_add("ctcp msg", (SIGNAL_FUNC) ctcp_msg);
|
||||
@ -206,7 +209,7 @@ void ctcp_init(void)
|
||||
|
||||
void ctcp_deinit(void)
|
||||
{
|
||||
signal_remove("server disconnected", (SIGNAL_FUNC) ctcp_deinit_server);
|
||||
signal_remove("server disconnected", (SIGNAL_FUNC) sig_disconnected);
|
||||
signal_remove("event privmsg", (SIGNAL_FUNC) event_privmsg);
|
||||
signal_remove("event notice", (SIGNAL_FUNC) event_notice);
|
||||
signal_remove("ctcp msg", (SIGNAL_FUNC) ctcp_msg);
|
||||
|
@ -913,6 +913,9 @@ static void sig_server_disconnected(IRC_SERVER_REC *server)
|
||||
{
|
||||
g_return_if_fail(server != NULL);
|
||||
|
||||
if (!irc_server_check(server))
|
||||
return;
|
||||
|
||||
while (server->knockoutlist != NULL)
|
||||
knockout_destroy(server, server->knockoutlist->data);
|
||||
}
|
||||
|
@ -350,14 +350,6 @@ static void irc_init_server(IRC_SERVER_REC *server)
|
||||
(GInputFunction) irc_parse_incoming, server);
|
||||
}
|
||||
|
||||
static void irc_deinit_server(IRC_SERVER_REC *server)
|
||||
{
|
||||
g_return_if_fail(server != NULL);
|
||||
|
||||
if (server->readtag > 0)
|
||||
g_source_remove(server->readtag);
|
||||
}
|
||||
|
||||
#define isoptchan(a) \
|
||||
(ischannel((a)[0]) || ((a)[0] == '*' && ((a)[1] == '\0' || (a)[1] == ' ')))
|
||||
|
||||
@ -400,7 +392,6 @@ void irc_irc_init(void)
|
||||
|
||||
signal_add("server event", (SIGNAL_FUNC) irc_server_event);
|
||||
signal_add("server connected", (SIGNAL_FUNC) irc_init_server);
|
||||
signal_add_first("server disconnected", (SIGNAL_FUNC) irc_deinit_server);
|
||||
signal_add("server incoming", (SIGNAL_FUNC) irc_parse_incoming_line);
|
||||
|
||||
current_server_event = NULL;
|
||||
@ -414,7 +405,6 @@ void irc_irc_deinit(void)
|
||||
{
|
||||
signal_remove("server event", (SIGNAL_FUNC) irc_server_event);
|
||||
signal_remove("server connected", (SIGNAL_FUNC) irc_init_server);
|
||||
signal_remove("server disconnected", (SIGNAL_FUNC) irc_deinit_server);
|
||||
signal_remove("server incoming", (SIGNAL_FUNC) irc_parse_incoming_line);
|
||||
|
||||
module_uniq_destroy("IRC");
|
||||
|
@ -284,6 +284,9 @@ static void sig_disconnected(IRC_SERVER_REC *server)
|
||||
{
|
||||
g_return_if_fail(server != NULL);
|
||||
|
||||
if (!irc_server_check(server))
|
||||
return;
|
||||
|
||||
g_hash_table_foreach(server->splits, (GHFunc) netsplit_destroy_hash, server);
|
||||
g_hash_table_destroy(server->splits);
|
||||
}
|
||||
|
@ -217,6 +217,9 @@ static void sig_disconnected(IRC_SERVER_REC *server)
|
||||
{
|
||||
g_return_if_fail(server != NULL);
|
||||
|
||||
if (!irc_server_check(server))
|
||||
return;
|
||||
|
||||
while (server->idles != NULL)
|
||||
server_idle_destroy(server, server->idles->data);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user