diff options
-rw-r--r-- | src/fe-common/irc/notifylist/fe-notifylist.c | 10 | ||||
-rw-r--r-- | src/irc/notifylist/notifylist.c | 10 |
2 files changed, 13 insertions, 7 deletions
diff --git a/src/fe-common/irc/notifylist/fe-notifylist.c b/src/fe-common/irc/notifylist/fe-notifylist.c index b5a87f5d..cd9adf9c 100644 --- a/src/fe-common/irc/notifylist/fe-notifylist.c +++ b/src/fe-common/irc/notifylist/fe-notifylist.c @@ -59,7 +59,7 @@ static void print_notify_onserver(IRC_SERVER_REC *server, GSList *nicks, GSList *tmp; GString *str; - g_return_if_fail(server != NULL); + g_return_if_fail(IS_IRC_SERVER(server)); g_return_if_fail(offline != NULL); g_return_if_fail(desc != NULL); @@ -104,10 +104,12 @@ static void cmd_notify_show(void) for (tmp = chatnets; tmp != NULL; tmp = tmp->next) { IRC_CHATNET_REC *rec = tmp->data; - if (!IS_IRCNET(rec)) continue; + if (!IS_IRCNET(rec)) + continue; server = (IRC_SERVER_REC *) server_find_chatnet(rec->name); - if (server == NULL) continue; + if (!IS_IRC_SERVER(server)) + continue; print_notify_onserver(server, nicks, &offline, rec->name); } @@ -116,7 +118,7 @@ static void cmd_notify_show(void) for (tmp = servers; tmp != NULL; tmp = tmp->next) { server = tmp->data; - if (server->connrec->chatnet != NULL) + if (!IS_IRC_SERVER(server) || server->connrec->chatnet != NULL) continue; print_notify_onserver(server, nicks, &offline, server->tag); } diff --git a/src/irc/notifylist/notifylist.c b/src/irc/notifylist/notifylist.c index 630df790..e8f4f829 100644 --- a/src/irc/notifylist/notifylist.c +++ b/src/irc/notifylist/notifylist.c @@ -134,7 +134,7 @@ int notifylist_ison_server(IRC_SERVER_REC *server, const char *nick) NOTIFY_NICK_REC *rec; g_return_val_if_fail(nick != NULL, FALSE); - g_return_val_if_fail(server != NULL, FALSE); + g_return_val_if_fail(IS_IRC_SERVER(server), FALSE); rec = notify_nick_find(server, nick); return rec != NULL && rec->host_ok && rec->away_ok && rec->idle_ok; @@ -154,7 +154,8 @@ static IRC_SERVER_REC *notifylist_ison_serverlist(const char *nick, const char * for (tmp = list; *tmp != NULL; tmp++) { server = (IRC_SERVER_REC *) server_find_chatnet(*tmp); - if (server != NULL && notifylist_ison_server(server, nick)) + if (IS_IRC_SERVER(server) && + notifylist_ison_server(server, nick)) break; } g_strfreev(list); @@ -174,7 +175,10 @@ IRC_SERVER_REC *notifylist_ison(const char *nick, const char *serverlist) /* any server.. */ for (tmp = servers; tmp != NULL; tmp = tmp->next) { - if (notifylist_ison_server(tmp->data, nick)) + IRC_SERVER_REC *server = tmp->data; + + if (IS_IRC_SERVER(server) && + notifylist_ison_server(server, nick)) return tmp->data; } |