mirror of
https://github.com/irssi/irssi.git
synced 2026-08-09 11:50:10 +02:00
When netsplit is over, irssi prints "Netsplit over, joins: (nicks)" and
hides all the real JOIN messages. Fixed also some netsplit bugs. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@414 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
cf7d6915f5
commit
bb76eec0ff
10 changed files with 394 additions and 20 deletions
|
|
@ -243,9 +243,8 @@ static void event_join(const char *data, IRC_SERVER_REC *server, const char *nic
|
|||
|
||||
/* check if split is over */
|
||||
rec = g_hash_table_lookup(server->splits, nick);
|
||||
if (rec == NULL) return;
|
||||
|
||||
if (g_strcasecmp(rec->address, address) == 0) {
|
||||
if (rec != NULL && g_strcasecmp(rec->address, address) == 0) {
|
||||
/* yep, looks like it is. for same people that had the same
|
||||
splitted servers set the timeout to one minute.
|
||||
|
||||
|
|
@ -253,8 +252,17 @@ static void event_join(const char *data, IRC_SERVER_REC *server, const char *nic
|
|||
same nick (unless the server is broken) so don't bother
|
||||
checking that the nick's server matches the split. */
|
||||
g_hash_table_foreach(server->splits, (GHFunc) split_set_timeout, rec);
|
||||
} else {
|
||||
/* back from different address.. just destroy it. */
|
||||
}
|
||||
}
|
||||
|
||||
/* remove the nick from netsplit, but do it last so that other "event join"
|
||||
signal handlers can check if the join was a netjoin */
|
||||
static void event_join_last(const char *data, IRC_SERVER_REC *server, const char *nick, const char *address)
|
||||
{
|
||||
NETSPLIT_REC *rec;
|
||||
|
||||
rec = g_hash_table_lookup(server->splits, nick);
|
||||
if (rec != NULL) {
|
||||
g_hash_table_remove(server->splits, rec->nick);
|
||||
netsplit_destroy(server, rec);
|
||||
}
|
||||
|
|
@ -306,6 +314,7 @@ void netsplit_init(void)
|
|||
{
|
||||
split_tag = g_timeout_add(1000, (GSourceFunc) split_check_old, NULL);
|
||||
signal_add_first("event join", (SIGNAL_FUNC) event_join);
|
||||
signal_add_last("event join", (SIGNAL_FUNC) event_join_last);
|
||||
signal_add_first("event quit", (SIGNAL_FUNC) event_quit);
|
||||
signal_add("server disconnected", (SIGNAL_FUNC) sig_disconnected);
|
||||
}
|
||||
|
|
@ -319,6 +328,7 @@ void netsplit_deinit(void)
|
|||
|
||||
g_source_remove(split_tag);
|
||||
signal_remove("event join", (SIGNAL_FUNC) event_join);
|
||||
signal_remove("event join", (SIGNAL_FUNC) event_join_last);
|
||||
signal_remove("event quit", (SIGNAL_FUNC) event_quit);
|
||||
signal_remove("server disconnected", (SIGNAL_FUNC) sig_disconnected);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ typedef struct {
|
|||
char *server;
|
||||
char *destserver;
|
||||
int count;
|
||||
int prints; /* temp variable */
|
||||
|
||||
time_t last; /* last time we received a QUIT msg here */
|
||||
} NETSPLIT_SERVER_REC;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue