- Repair channels_rejoin_unavailable. Enabled by default,

this retries joins that failed because of netsplits
  (channel temporarily unavailable (437), duplicate channel)
  A few servers abuse 437 for juped channels which should
  not be retried, you should disable channels_rejoin_unavailable
  if this is a problem.
- Display 437 and 407 numerics if channels_rejoin_unavailable
  is not enabled.

Bug #495


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4537 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Jilles Tjoelker 2007-06-03 13:08:47 +00:00 committed by jilles
commit c0674522ae
2 changed files with 19 additions and 29 deletions

View file

@ -60,7 +60,8 @@ static void irc_server_event(IRC_SERVER_REC *server, const char *line)
indicate that the join failed. */
params = event_get_params(line, 3, &numeric, NULL, &channel);
if (numeric[0] == '4')
/* 437 is handled specially in src/irc/core/channel-rejoin.c */
if (numeric[0] == '4' && (numeric[1] != '3' || numeric[2] != '7'))
check_join_failure(server, channel);
g_free(params);
@ -117,21 +118,6 @@ static void event_duplicate_channel(IRC_SERVER_REC *server, const char *data)
g_free(params);
}
static void event_target_unavailable(IRC_SERVER_REC *server, const char *data)
{
char *params, *channel;
g_return_if_fail(data != NULL);
params = event_get_params(data, 2, NULL, &channel);
if (ischannel(*channel)) {
/* channel is unavailable - try to join again a bit later */
check_join_failure(server, channel);
}
g_free(params);
}
static void channel_change_topic(IRC_SERVER_REC *server, const char *channel,
const char *topic, const char *setby,
time_t settime)
@ -385,7 +371,6 @@ void channel_events_init(void)
signal_add("event invite", (SIGNAL_FUNC) event_invite);
signal_add("event 332", (SIGNAL_FUNC) event_topic_get);
signal_add("event 333", (SIGNAL_FUNC) event_topic_info);
signal_add_first("event 437", (SIGNAL_FUNC) event_target_unavailable); /* channel/nick unavailable */
}
void channel_events_deinit(void)
@ -401,5 +386,4 @@ void channel_events_deinit(void)
signal_remove("event invite", (SIGNAL_FUNC) event_invite);
signal_remove("event 332", (SIGNAL_FUNC) event_topic_get);
signal_remove("event 333", (SIGNAL_FUNC) event_topic_info);
signal_remove("event 437", (SIGNAL_FUNC) event_target_unavailable); /* channel/nick unavailable */
}