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

When joining to !channel because of "407 duplicate channel", it just

means that there's some server sync problems. rejoining after a while
should work again.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1033 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-01-01 04:33:27 +00:00 committed by cras
parent 078a10900f
commit 21f9da6092

View File

@ -102,6 +102,35 @@ static void channel_rejoin(IRC_SERVER_REC *server, const char *channel)
channel_destroy(CHANNEL(chanrec)); channel_destroy(CHANNEL(chanrec));
} }
static void event_duplicate_channel(IRC_SERVER_REC *server, const char *data)
{
CHANNEL_REC *chanrec;
char *params, *channel, *p;
g_return_if_fail(data != NULL);
params = event_get_params(data, 3, NULL, NULL, &channel);
p = strchr(channel, ' ');
if (p != NULL) *p = '\0';
if (channel[0] == '!' && channel[1] != '!') {
chanrec = channel_find(SERVER(server), channel);
if (chanrec != NULL && !chanrec->names_got) {
/* duplicate channel - this should only happen when
there's some sync problem with servers, rejoining
after a while should help.
note that this same 407 is sent when trying to
create !!channel that already exists so we don't
want to try rejoining then. */
channel_rejoin(server, channel);
signal_stop();
}
}
g_free(params);
}
static void event_target_unavailable(IRC_SERVER_REC *server, const char *data) static void event_target_unavailable(IRC_SERVER_REC *server, const char *data)
{ {
char *params, *channel; char *params, *channel;
@ -225,6 +254,7 @@ void channel_rejoin_init(void)
(GSourceFunc) sig_rejoin, NULL); (GSourceFunc) sig_rejoin, NULL);
command_bind("rmrejoins", NULL, (SIGNAL_FUNC) cmd_rmrejoins); command_bind("rmrejoins", NULL, (SIGNAL_FUNC) cmd_rmrejoins);
signal_add_first("event 407", (SIGNAL_FUNC) event_duplicate_channel);
signal_add_first("event 437", (SIGNAL_FUNC) event_target_unavailable); signal_add_first("event 437", (SIGNAL_FUNC) event_target_unavailable);
signal_add_first("channel joined", (SIGNAL_FUNC) sig_remove_rejoin); signal_add_first("channel joined", (SIGNAL_FUNC) sig_remove_rejoin);
signal_add_first("channel destroyed", (SIGNAL_FUNC) sig_remove_rejoin); signal_add_first("channel destroyed", (SIGNAL_FUNC) sig_remove_rejoin);
@ -236,6 +266,7 @@ void channel_rejoin_deinit(void)
g_source_remove(rejoin_tag); g_source_remove(rejoin_tag);
command_unbind("rmrejoins", (SIGNAL_FUNC) cmd_rmrejoins); command_unbind("rmrejoins", (SIGNAL_FUNC) cmd_rmrejoins);
signal_remove("event 407", (SIGNAL_FUNC) event_duplicate_channel);
signal_remove("event 437", (SIGNAL_FUNC) event_target_unavailable); signal_remove("event 437", (SIGNAL_FUNC) event_target_unavailable);
signal_remove("channel joined", (SIGNAL_FUNC) sig_remove_rejoin); signal_remove("channel joined", (SIGNAL_FUNC) sig_remove_rejoin);
signal_remove("channel destroyed", (SIGNAL_FUNC) sig_remove_rejoin); signal_remove("channel destroyed", (SIGNAL_FUNC) sig_remove_rejoin);