From 4f997ffe8f60b86ed5a9ae4960654b1b77480615 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 15 Oct 2000 21:14:13 +0000 Subject: [PATCH] Rejoin fixes git-svn-id: http://svn.irssi.org/repos/irssi/trunk@763 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/irc/module-formats.c | 2 +- src/irc/core/channel-rejoin.c | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/fe-common/irc/module-formats.c b/src/fe-common/irc/module-formats.c index 4aab9c08..b8e330ae 100644 --- a/src/fe-common/irc/module-formats.c +++ b/src/fe-common/irc/module-formats.c @@ -56,7 +56,7 @@ FORMAT_REC fecommon_irc_formats[] = { { "joinerror_bad_mask", "Cannot join to channel %_$0%_ %K(%nBad channel mask%K)", 1, { 0 } }, { "joinerror_unavail", "Cannot join to channel %_$0%_ %K(%nChannel is temporarily unavailable%K)", 1, { 0 } }, { "joinerror_duplicate", "Channel %_$0%_ already exists - cannot create it", 1, { 0 } }, - { "channel_rejoin", "Channel %_$0%_ is temporarily unavailable, this is normally because of netsplits. Irssi will now automatically try to rejoin to this channel until the join is successfull. Use /RMREJOINS command if you wish to abort this.", 1, { 0 } }, + { "channel_rejoin", "Channel %_$0%_ is temporarily unavailable, this is normally because of netsplits. Irssi will now automatically try to rejoin back to this channel until the join is successful. Use /RMREJOINS command if you wish to abort this.", 1, { 0 } }, { "inviting", "Inviting $0 to %_$1", 2, { 0, 0 } }, { "not_invited", "You have not been invited to a channel!", 0 }, { "names", "%K[%g%_Users%_%K(%g$0%K)]%n $1", 2, { 0, 0 } }, diff --git a/src/irc/core/channel-rejoin.c b/src/irc/core/channel-rejoin.c index 0d50b0b2..7552efcc 100644 --- a/src/irc/core/channel-rejoin.c +++ b/src/irc/core/channel-rejoin.c @@ -85,18 +85,20 @@ static void channel_rejoin(IRC_SERVER_REC *server, const char *channel) g_free_and_null(rec->key); if (channel_have_key(chanrec)) rec->key = g_strdup(chanrec->key); - return; + } else { + /* new rejoin */ + rec = g_new0(REJOIN_REC, 1); + rec->channel = g_strdup(channel); + if (channel_have_key(chanrec)) + rec->key = g_strdup(chanrec->key); + + server->rejoin_channels = + g_slist_append(server->rejoin_channels, rec); + signal_emit("channel rejoin new", 2, server, rec); } - /* new rejoin */ - rec = g_new0(REJOIN_REC, 1); - rec->channel = g_strdup(channel); - if (channel_have_key(chanrec)) - rec->key = g_strdup(chanrec->key); - - server->rejoin_channels = - g_slist_append(server->rejoin_channels, rec); - signal_emit("channel rejoin new", 2, server, rec); + chanrec->left = TRUE; + channel_destroy(CHANNEL(chanrec)); } static void event_target_unavailable(const char *data, IRC_SERVER_REC *server)