*** - Tue Oct 24 12:36:36 2000 --- epic4-0.9.10/source/names.c Tue Oct 24 12:33:59 2000 *************** *** 1682,1688 **** void channel_check_windows (void) { Channel *tmp = NULL; - char *retval = NULL; Window *w = NULL; int reset = 0; --- 1682,1687 ---- *************** *** 1765,1777 **** if (tmp->window == NULL) panic("I thought we just checked for this! [3]"); ! if (tmp->window->current_channel == NULL) { ! yell("Repaired referential integrity failure: " ! "Window [%d] has channels, but no current " "channel -- making [%s] the current channel.", tmp->window->refnum, tmp->channel); ! set_channel_by_refnum(tmp->window->refnum, tmp->channel); } } --- 1764,1781 ---- if (tmp->window == NULL) panic("I thought we just checked for this! [3]"); ! /* Defer this check until after we have attempted rejoin */ ! if (did_server_rejoin_channels(tmp->server)) { ! if (tmp->window->current_channel == NULL && ! tmp->window->waiting_channel == NULL) ! { ! yell("Repaired referential integrity failure: " ! "Window [%d] has channels, but no current or waiting" "channel -- making [%s] the current channel.", tmp->window->refnum, tmp->channel); ! set_channel_by_refnum(tmp->window->refnum, tmp->channel); ! } } } *************** *** 1782,1792 **** if (tmp->window == NULL) panic("I thought we just checked for this! [4]"); ! if (is_server_open(tmp->server) && tmp->inactive) panic("Channel [%s] on server [%d] is inactive " "even though this server is connected!", tmp->channel, tmp->server); ! if (!is_server_open(tmp->server) && !tmp->inactive) panic("Channel [%s] on server [%d] is NOT inactive " "even though this server is NOT connected!", tmp->channel, tmp->server); --- 1786,1796 ---- if (tmp->window == NULL) panic("I thought we just checked for this! [4]"); ! if (did_server_rejoin_channels(tmp->server) && tmp->inactive) panic("Channel [%s] on server [%d] is inactive " "even though this server is connected!", tmp->channel, tmp->server); ! if (!did_server_rejoin_channels(tmp->server) && !tmp->inactive) panic("Channel [%s] on server [%d] is NOT inactive " "even though this server is NOT connected!", tmp->channel, tmp->server); *** - Tue Oct 24 12:36:36 2000 --- epic4-0.9.10/source/notice.c Tue Oct 24 12:25:09 2000 *************** *** 370,375 **** --- 370,376 ---- } reconnect_all_channels(); + server_did_rejoin_channels(from_server); message_from(NULL, LOG_CRAP); reinstate_user_modes(); *************** *** 405,410 **** --- 406,412 ---- update_all_status(); do_hook(CONNECT_LIST, "%s %d %s", get_server_name(from_server), get_server_port(from_server), get_server_itsname(from_server)); + window_check_channels(); } int kill_message (const char *from, char *cline) *** - Tue Oct 24 12:36:37 2000 --- epic4-0.9.10/source/parse.c Tue Oct 24 12:10:21 2000 *************** *** 637,643 **** * NOTE: If you want to change it, you *will* have to do it yourself. * Im quite serious. Im not going to change this. */ ! static void p_kill (char *from, char **ArgList) { /* * Bogorific Microsoft Exchange ``IRC'' server sends out a KILL --- 637,643 ---- * NOTE: If you want to change it, you *will* have to do it yourself. * Im quite serious. Im not going to change this. */ ! static void p_kill (char *from, char **ArgList) { /* * Bogorific Microsoft Exchange ``IRC'' server sends out a KILL *** - Tue Oct 24 12:36:37 2000 --- epic4-0.9.10/source/server.c Tue Oct 24 12:20:25 2000 *************** *** 1601,1611 **** --- 1601,1628 ---- server_list[sic_index].connected = value; server_list[sic_index].registration_pending = 0; + server_list[sic_index].rejoined_channels = 0; if (value) { server_list[sic_index].eof = 0; clear_reconnect_counts(); } + } + + void server_did_rejoin_channels (int sic_index) + { + if (sic_index < 0 || sic_index >= number_of_servers) + return; + server_list[sic_index].rejoined_channels = 1; + } + + int did_server_rejoin_channels (int sic_index) + { + if (sic_index < 0 || sic_index >= number_of_servers) + return 0; + if (server_list[sic_index].connected == 0) + return 0; + return server_list[sic_index].rejoined_channels; } BUILT_IN_COMMAND(disconnectcmd) *** - Tue Oct 24 12:36:38 2000 --- epic4-0.9.10/include/server.h Tue Oct 24 12:23:05 2000 *************** *** 34,39 **** --- 34,40 ---- int nickname_pending; /* Is a NICK command pending? */ int resetting_nickname; /* Is a nickname reset in progress? */ int registration_pending; /* Is a registration going on ? */ + int rejoined_channels; /* Has we tried to auto-rejoin? */ char *userhost; /* my userhost on this server */ char *away; /* away message for this server */ int oper; /* true if operator */ *************** *** 181,185 **** --- 182,189 ---- const char * get_server_redirect (int); int check_server_redirect (const char *); void save_servers (FILE *); + + void server_did_rejoin_channels (int); + int did_server_rejoin_channels (int); #endif /* _SERVER_H_ */