Skip to content

Commit

Permalink
Merge branch 'netjoin-timeout' into 'master'
Browse files Browse the repository at this point in the history
fe-netjoin: remove irc servers on "server disconnected" signal

Closes #7

See merge request !10
  • Loading branch information
Ailin Nemui committed Mar 10, 2017
2 parents 26187d1 + 7c09b72 commit 77b2631
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/fe-common/irc/fe-netjoin.c
Expand Up @@ -470,6 +470,20 @@ static void read_settings(void)
}
}

static void sig_server_disconnected(IRC_SERVER_REC *server)
{
NETJOIN_SERVER_REC *netjoin_server;

g_return_if_fail(server != NULL);

if (!IS_IRC_SERVER(server))
return;

if ((netjoin_server = netjoin_find_server(server))) {
netjoin_server_remove(netjoin_server);
}
}

void fe_netjoin_init(void)
{
settings_add_bool("misc", "hide_netsplit_quits", TRUE);
Expand All @@ -480,6 +494,7 @@ void fe_netjoin_init(void)

read_settings();
signal_add("setup changed", (SIGNAL_FUNC) read_settings);
signal_add("server disconnected", (SIGNAL_FUNC) sig_server_disconnected);
}

void fe_netjoin_deinit(void)
Expand All @@ -492,6 +507,7 @@ void fe_netjoin_deinit(void)
}

signal_remove("setup changed", (SIGNAL_FUNC) read_settings);
signal_remove("server disconnected", (SIGNAL_FUNC) sig_server_disconnected);

signal_remove("message quit", (SIGNAL_FUNC) msg_quit);
signal_remove("message join", (SIGNAL_FUNC) msg_join);
Expand Down

0 comments on commit 77b2631

Please sign in to comment.