summaryrefslogtreecommitdiff
path: root/src/fe-common/irc
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-10-14 00:45:16 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-10-14 00:45:16 +0000
commit6a3efe49ab7b41062650da894eccc2d4be0b8f45 (patch)
treee60a8f2eaaef04f87d9c8752f2742acc4f5e41bb /src/fe-common/irc
parentf850204479e84c3112b6353da48a5a1ec81bb1fe (diff)
downloadirssi-6a3efe49ab7b41062650da894eccc2d4be0b8f45.zip
Autorejoin when join temporarily fails because of netsplit is handled
better now. Irssi prints a nice message about it only once and you can abort it with /RMREJOINS command. "channel query" -> "channel joined" channels_join() must not use cmd_return|param_error() commands since we don't necessarily call it from command handler and signal_stop() could cause some damage. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@739 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/irc')
-rw-r--r--src/fe-common/irc/fe-irc-channels.c13
-rw-r--r--src/fe-common/irc/module-formats.c1
-rw-r--r--src/fe-common/irc/module-formats.h1
3 files changed, 15 insertions, 0 deletions
diff --git a/src/fe-common/irc/fe-irc-channels.c b/src/fe-common/irc/fe-irc-channels.c
index bb22e54d..8a7de92d 100644
--- a/src/fe-common/irc/fe-irc-channels.c
+++ b/src/fe-common/irc/fe-irc-channels.c
@@ -19,11 +19,22 @@
*/
#include "module.h"
+#include "module-formats.h"
#include "signals.h"
#include "commands.h"
+#include "levels.h"
#include "servers.h"
#include "irc.h"
+#include "channel-rejoin.h"
+
+static void sig_channel_rejoin(IRC_SERVER_REC *server, REJOIN_REC *rec)
+{
+ g_return_if_fail(rec != NULL);
+
+ printformat(server, NULL, MSGLEVEL_CLIENTNOTICE,
+ IRCTXT_CHANNEL_REJOIN, rec->channel);
+}
static void cmd_channel(const char *data, SERVER_REC *server)
{
@@ -35,10 +46,12 @@ static void cmd_channel(const char *data, SERVER_REC *server)
void fe_irc_channels_init(void)
{
+ signal_add("channel rejoin new", (SIGNAL_FUNC) sig_channel_rejoin);
command_bind("channel", NULL, (SIGNAL_FUNC) cmd_channel);
}
void fe_irc_channels_deinit(void)
{
+ signal_remove("channel rejoin new", (SIGNAL_FUNC) sig_channel_rejoin);
command_unbind("channel", (SIGNAL_FUNC) cmd_channel);
}
diff --git a/src/fe-common/irc/module-formats.c b/src/fe-common/irc/module-formats.c
index d71152f9..4b193840 100644
--- a/src/fe-common/irc/module-formats.c
+++ b/src/fe-common/irc/module-formats.c
@@ -55,6 +55,7 @@ FORMAT_REC fecommon_irc_formats[] = {
{ "joinerror_bad_key", "Cannot join to channel %_$0%_ %K(%nBad channel key%K)", 1, { 0 } },
{ "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 } },
+ { "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 } },
{ "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/fe-common/irc/module-formats.h b/src/fe-common/irc/module-formats.h
index 46e91322..75e84a4b 100644
--- a/src/fe-common/irc/module-formats.h
+++ b/src/fe-common/irc/module-formats.h
@@ -32,6 +32,7 @@ enum {
IRCTXT_JOINERROR_BAD_KEY,
IRCTXT_JOINERROR_BAD_MASK,
IRCTXT_JOINERROR_UNAVAIL,
+ IRCTXT_CHANNEL_REJOIN,
IRCTXT_INVITING,
IRCTXT_NOT_INVITED,
IRCTXT_NAMES,