1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

A few checks to check that we really are dealing with IRC servers.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@465 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-07-15 13:08:39 +00:00 committed by cras
parent 2afaadb2d7
commit 5707140938
6 changed files with 26 additions and 4 deletions

View File

@ -105,6 +105,9 @@ static int nick_completion_timeout(void)
for (tmp = servers; tmp != NULL; tmp = tmp->next) { for (tmp = servers; tmp != NULL; tmp = tmp->next) {
IRC_SERVER_REC *rec = tmp->data; IRC_SERVER_REC *rec = tmp->data;
if (!irc_server_check(rec))
continue;
len = g_slist_length(rec->lastmsgs); len = g_slist_length(rec->lastmsgs);
if (len > 0 && len >= settings_get_int("completion_keep_privates")) { if (len > 0 && len >= settings_get_int("completion_keep_privates")) {
link = g_slist_last(rec->lastmsgs); link = g_slist_last(rec->lastmsgs);

View File

@ -811,6 +811,9 @@ static void knockout_timeout_server(IRC_SERVER_REC *server)
g_return_if_fail(server != NULL); g_return_if_fail(server != NULL);
if (!irc_server_check(server))
return;
t = server->knockout_lastcheck == 0 ? 0 : t = server->knockout_lastcheck == 0 ? 0 :
time(NULL)-server->knockout_lastcheck; time(NULL)-server->knockout_lastcheck;
server->knockout_lastcheck = time(NULL); server->knockout_lastcheck = time(NULL);

View File

@ -159,6 +159,9 @@ IRC_SERVER_REC *irc_server_connect(IRC_SERVER_CONNECT_REC *conn)
static void sig_connected(IRC_SERVER_REC *server) static void sig_connected(IRC_SERVER_REC *server)
{ {
if (!irc_server_check(server))
return;
server->eventtable = g_hash_table_new((GHashFunc) g_istr_hash, (GCompareFunc) g_istr_equal); server->eventtable = g_hash_table_new((GHashFunc) g_istr_hash, (GCompareFunc) g_istr_equal);
server->eventgrouptable = g_hash_table_new((GHashFunc) g_direct_hash, (GCompareFunc) g_direct_equal); server->eventgrouptable = g_hash_table_new((GHashFunc) g_direct_hash, (GCompareFunc) g_direct_equal);
server->cmdtable = g_hash_table_new((GHashFunc) g_istr_hash, (GCompareFunc) g_istr_equal); server->cmdtable = g_hash_table_new((GHashFunc) g_istr_hash, (GCompareFunc) g_istr_equal);
@ -196,6 +199,9 @@ static void sig_disconnected(IRC_SERVER_REC *server)
{ {
int chans; int chans;
if (!irc_server_check(server))
return;
/* close all channels */ /* close all channels */
chans = server_remove_channels(server); chans = server_remove_channels(server);
@ -235,6 +241,9 @@ static void server_cmd_timeout(IRC_SERVER_REC *server, GTimeVal *now)
char *cmd; char *cmd;
int len, ret, add_rawlog; int len, ret, add_rawlog;
if (!irc_server_check(server))
return;
if (server->cmdcount == 0 && server->cmdqueue == NULL) if (server->cmdcount == 0 && server->cmdqueue == NULL)
return; return;

View File

@ -231,8 +231,12 @@ static int sig_massjoin_timeout(void)
time_t max; time_t max;
max = time(NULL)-settings_get_int("massjoin_max_wait"); max = time(NULL)-settings_get_int("massjoin_max_wait");
for (tmp = servers; tmp != NULL; tmp = tmp->next) for (tmp = servers; tmp != NULL; tmp = tmp->next) {
server_check_massjoins(tmp->data, max); IRC_SERVER_REC *server = tmp->data;
if (irc_server_check(server))
server_check_massjoins(server, max);
}
return 1; return 1;
} }

View File

@ -19,6 +19,7 @@
*/ */
#include "module.h" #include "module.h"
#include "modules.h"
#include "signals.h" #include "signals.h"
#include "commands.h" #include "commands.h"
#include "misc.h" #include "misc.h"
@ -304,6 +305,7 @@ static int split_check_old(void)
for (tmp = servers; tmp != NULL; tmp = tmp->next) { for (tmp = servers; tmp != NULL; tmp = tmp->next) {
IRC_SERVER_REC *server = tmp->data; IRC_SERVER_REC *server = tmp->data;
if (irc_server_check(server))
g_hash_table_foreach_remove(server->splits, (GHRFunc) split_server_check, server); g_hash_table_foreach_remove(server->splits, (GHRFunc) split_server_check, server);
} }

View File

@ -229,7 +229,8 @@ static int sig_idle_timeout(void)
for (tmp = servers; tmp != NULL; tmp = tmp->next) { for (tmp = servers; tmp != NULL; tmp = tmp->next) {
IRC_SERVER_REC *rec = tmp->data; IRC_SERVER_REC *rec = tmp->data;
if (rec->idles != NULL && rec->cmdcount == 0) { if (irc_server_check(rec) &&
rec->idles != NULL && rec->cmdcount == 0) {
/* We're idling and we have idle commands to run! */ /* We're idling and we have idle commands to run! */
server_idle_next(rec); server_idle_next(rec);
} }