diff options
author | Timo Sirainen <cras@irssi.org> | 2000-10-01 16:17:12 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-10-01 16:17:12 +0000 |
commit | 8c2799b5f8da6d16808e5a25265db3198a7210d1 (patch) | |
tree | 6de6d5f1d0c0e06dc828719bf9e2cb90b58bb753 /src/irc | |
parent | 414348ca3c639625188d9be4daf27c3c47f82427 (diff) | |
download | irssi-8c2799b5f8da6d16808e5a25265db3198a7210d1.zip |
multiprotocol fixes
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@703 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/flood/autoignore.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/irc/flood/autoignore.c b/src/irc/flood/autoignore.c index 7b386fe3..95967686 100644 --- a/src/irc/flood/autoignore.c +++ b/src/irc/flood/autoignore.c @@ -40,7 +40,7 @@ GSList *server_autoignores(IRC_SERVER_REC *server) { MODULE_SERVER_REC *rec; - g_return_val_if_fail(server != NULL, NULL); + g_return_val_if_fail(IS_IRC_SERVER(server), NULL); rec = MODULE_DATA(server); return rec->ignorelist; @@ -50,7 +50,7 @@ static void autoignore_remove_rec(IRC_SERVER_REC *server, AUTOIGNORE_REC *rec) { MODULE_SERVER_REC *mserver; - g_return_if_fail(server != NULL); + g_return_if_fail(IS_IRC_SERVER(server)); g_return_if_fail(rec != NULL); signal_emit("autoignore remove", 2, server, rec); @@ -67,7 +67,7 @@ static AUTOIGNORE_REC *autoignore_find(IRC_SERVER_REC *server, const char *mask) MODULE_SERVER_REC *mserver; GSList *tmp; - g_return_val_if_fail(server != NULL, NULL); + g_return_val_if_fail(IS_IRC_SERVER(server), NULL); g_return_val_if_fail(mask != NULL, NULL); mserver = MODULE_DATA(server); @@ -89,7 +89,6 @@ static void autoignore_timeout_server(IRC_SERVER_REC *server) time_t t; g_return_if_fail(server != NULL); - if (!IS_IRC_SERVER(server)) return; @@ -120,8 +119,6 @@ static void autoignore_init_server(IRC_SERVER_REC *server) { MODULE_SERVER_REC *mserver; - g_return_if_fail(server != NULL); - if (!IS_IRC_SERVER(server)) return; @@ -134,8 +131,6 @@ static void autoignore_deinit_server(IRC_SERVER_REC *server) { MODULE_SERVER_REC *mserver; - g_return_if_fail(server != NULL); - if (!IS_IRC_SERVER(server)) return; @@ -167,9 +162,8 @@ void autoignore_add(IRC_SERVER_REC *server, const char *nick, int level) IGNORE_REC *irec; int igtime; - g_return_if_fail(server != NULL); g_return_if_fail(nick != NULL); - if (level == 0) return; + if (level == 0 || !IRC_SERVER(server)) return; igtime = settings_get_int("autoignore_time"); if (igtime <= 0) return; @@ -209,8 +203,9 @@ int autoignore_remove(IRC_SERVER_REC *server, const char *mask, int level) AUTOIGNORE_REC *rec; IGNORE_REC *irec; - g_return_val_if_fail(server != NULL, FALSE); g_return_val_if_fail(mask != NULL, FALSE); + if (!IS_IRC_SERVER(server)) + return FALSE; irec = ignore_find_server(server, mask); if (irec != NULL) { @@ -232,6 +227,8 @@ static void sig_flood(IRC_SERVER_REC *server, const char *nick, const char *host { int level, check_level; + g_return_if_fail(IS_IRC_SERVER(server)); + level = GPOINTER_TO_INT(levelp); check_level = level2bits(settings_get_str("autoignore_levels")); @@ -249,6 +246,9 @@ static void autoignore_remove_level(const char *nick, int level) for (tmp = servers; tmp != NULL; tmp = tmp->next) { IRC_SERVER_REC *server = tmp->data; + if (!IS_IRC_SERVER(server)) + continue; + rec = autoignore_find(server, nick); if (rec != NULL && (rec->level & level)) { rec->level &= ~level; |