1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-29 04:45:57 -04: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) {
IRC_SERVER_REC *rec = tmp->data;
if (!irc_server_check(rec))
continue;
len = g_slist_length(rec->lastmsgs);
if (len > 0 && len >= settings_get_int("completion_keep_privates")) {
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);
if (!irc_server_check(server))
return;
t = server->knockout_lastcheck == 0 ? 0 :
time(NULL)-server->knockout_lastcheck;
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)
{
if (!irc_server_check(server))
return;
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->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;
if (!irc_server_check(server))
return;
/* close all channels */
chans = server_remove_channels(server);
@ -235,6 +241,9 @@ static void server_cmd_timeout(IRC_SERVER_REC *server, GTimeVal *now)
char *cmd;
int len, ret, add_rawlog;
if (!irc_server_check(server))
return;
if (server->cmdcount == 0 && server->cmdqueue == NULL)
return;

View File

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

View File

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

View File

@ -229,7 +229,8 @@ static int sig_idle_timeout(void)
for (tmp = servers; tmp != NULL; tmp = tmp->next) {
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! */
server_idle_next(rec);
}