From 6d88345f30c33fcda9fe792cbe9025096f4a3c01 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 30 Nov 2000 01:44:07 +0000 Subject: While waiting for more netsplits/netjoins, if anything else is printed to screen, print the current netsplit/netjoin messages before that text. not tested, hope it works ;) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@900 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/irc/fe-netjoin.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/fe-common/irc/fe-netjoin.c') diff --git a/src/fe-common/irc/fe-netjoin.c b/src/fe-common/irc/fe-netjoin.c index 7799bbe2..5fe10481 100644 --- a/src/fe-common/irc/fe-netjoin.c +++ b/src/fe-common/irc/fe-netjoin.c @@ -228,6 +228,20 @@ static void print_netjoins(NETJOIN_SERVER_REC *server) netjoin_server_remove(server); } +/* something is going to be printed to screen, print our current netsplit + message before it. */ +static void sig_print_starting(void) +{ + GSList *tmp; + + for (tmp = joinservers; tmp != NULL; tmp = tmp->next) { + NETJOIN_SERVER_REC *server = tmp->data; + + if (server->netjoins != NULL) + print_netjoins(server); + } +} + static int sig_check_netjoins(void) { GSList *tmp, *next; @@ -253,6 +267,7 @@ static int sig_check_netjoins(void) if (joinservers == NULL) { g_source_remove(join_tag); + signal_remove("print starting", (SIGNAL_FUNC) sig_print_starting); join_tag = -1; } return 1; @@ -286,6 +301,7 @@ static void msg_join(IRC_SERVER_REC *server, const char *channel, if (join_tag == -1) { join_tag = g_timeout_add(1000, (GSourceFunc) sig_check_netjoins, NULL); + signal_add("print starting", (SIGNAL_FUNC) sig_print_starting); } if (netjoin == NULL) @@ -390,7 +406,10 @@ void fe_netjoin_deinit(void) { while (joinservers != NULL) netjoin_server_remove(joinservers->data); - if (join_tag != -1) g_source_remove(join_tag); + if (join_tag != -1) { + g_source_remove(join_tag); + signal_remove("print starting", (SIGNAL_FUNC) sig_print_starting); + } signal_remove("setup changed", (SIGNAL_FUNC) read_settings); } -- cgit v1.2.3