summaryrefslogtreecommitdiff
path: root/src/fe-common/irc/fe-netsplit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fe-common/irc/fe-netsplit.c')
-rw-r--r--src/fe-common/irc/fe-netsplit.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/fe-common/irc/fe-netsplit.c b/src/fe-common/irc/fe-netsplit.c
index 4c69dd10..258d0d57 100644
--- a/src/fe-common/irc/fe-netsplit.c
+++ b/src/fe-common/irc/fe-netsplit.c
@@ -199,7 +199,7 @@ static void temp_split_chan_free(TEMP_SPLIT_CHAN_REC *rec)
g_free(rec);
}
-static void print_splits(IRC_SERVER_REC *server, const char *channel)
+static void print_splits(IRC_SERVER_REC *server, const char *filter_channel)
{
TEMP_SPLIT_REC temp;
GSList *servers;
@@ -218,7 +218,7 @@ static void print_splits(IRC_SERVER_REC *server, const char *channel)
g_hash_table_foreach(server->splits,
(GHFunc) get_server_splits, &temp);
- print_server_splits(server, &temp, channel);
+ print_server_splits(server, &temp, filter_channel);
g_slist_foreach(temp.channels,
(GFunc) temp_split_chan_free, NULL);
@@ -255,15 +255,16 @@ static void sig_print_starting(TEXT_DEST_REC *dest)
if (!IS_IRC_SERVER(dest->server))
return;
- if (!(dest->level & MSGLEVEL_PUBLIC))
- return;
-
- if (!server_ischannel(dest->server, dest->target))
- return;
-
rec = IRC_SERVER(dest->server);
- if (rec->split_servers != NULL)
- print_splits(rec, dest->target);
+ if (rec->split_servers != NULL) {
+ /* if split_servers exists, the server rec should be
+ still valid. otherwise, calling server->ischannel
+ may not be safe. */
+ if (dest->target != NULL && !server_ischannel((SERVER_REC *) rec, dest->target))
+ return;
+
+ print_splits(rec, NULL);
+ }
}
static int sig_check_splits(void)