diff options
author | Timo Sirainen <cras@irssi.org> | 2000-10-14 01:03:11 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-10-14 01:03:11 +0000 |
commit | d398247f762e111e82f418af142dd7e70d1d167a (patch) | |
tree | ebdc9a90306671794f34dbee22a96fd28e9876a0 /src/fe-common | |
parent | ad97695841d0121759c0dd980d8d54786415cb5f (diff) | |
download | irssi-d398247f762e111e82f418af142dd7e70d1d167a.zip |
Handle event "407 duplicate channel" correctly - happens when trying to
create !channel (/join !!channel) while it already exists.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@741 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common')
-rw-r--r-- | src/fe-common/irc/fe-events-numeric.c | 22 | ||||
-rw-r--r-- | src/fe-common/irc/module-formats.c | 1 | ||||
-rw-r--r-- | src/fe-common/irc/module-formats.h | 1 |
3 files changed, 24 insertions, 0 deletions
diff --git a/src/fe-common/irc/fe-events-numeric.c b/src/fe-common/irc/fe-events-numeric.c index 4c365a51..88775eb1 100644 --- a/src/fe-common/irc/fe-events-numeric.c +++ b/src/fe-common/irc/fe-events-numeric.c @@ -587,6 +587,26 @@ static void event_too_many_channels(const char *data, IRC_SERVER_REC *server) cannot_join(data, server, IRCTXT_JOINERROR_TOOMANY); } +static void event_duplicate_channel(const char *data, IRC_SERVER_REC *server) +{ + char *params, *channel, *p; + + g_return_if_fail(data != NULL); + + /* this new addition to ircd breaks completely with older + "standards", "nick Duplicate ::!!channel ...." */ + params = event_get_params(data, 3, NULL, NULL, &channel); + p = strchr(channel, ' '); + if (p != NULL) *p = '\0'; + + if (channel[0] == '!' && channel[1] == '!') { + printformat(server, NULL, MSGLEVEL_CRAP, + IRCTXT_JOINERROR_DUPLICATE, channel+1); + } + + g_free(params); +} + static void event_channel_is_full(const char *data, IRC_SERVER_REC *server) { cannot_join(data, server, IRCTXT_JOINERROR_FULL); @@ -710,6 +730,7 @@ void fe_events_numeric_init(void) signal_add("event 401", (SIGNAL_FUNC) event_no_such_nick); signal_add("event 403", (SIGNAL_FUNC) event_no_such_channel); signal_add("event 405", (SIGNAL_FUNC) event_too_many_channels); + signal_add("event 407", (SIGNAL_FUNC) event_duplicate_channel); signal_add("event 471", (SIGNAL_FUNC) event_channel_is_full); signal_add("event 472", (SIGNAL_FUNC) event_unknown_mode); signal_add("event 473", (SIGNAL_FUNC) event_invite_only); @@ -768,6 +789,7 @@ void fe_events_numeric_deinit(void) signal_remove("event 401", (SIGNAL_FUNC) event_no_such_nick); signal_remove("event 403", (SIGNAL_FUNC) event_no_such_channel); signal_remove("event 405", (SIGNAL_FUNC) event_too_many_channels); + signal_remove("event 407", (SIGNAL_FUNC) event_duplicate_channel); signal_remove("event 471", (SIGNAL_FUNC) event_channel_is_full); signal_remove("event 472", (SIGNAL_FUNC) event_unknown_mode); signal_remove("event 473", (SIGNAL_FUNC) event_invite_only); diff --git a/src/fe-common/irc/module-formats.c b/src/fe-common/irc/module-formats.c index 4b193840..e9d41684 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 } }, + { "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 } }, { "inviting", "Inviting $0 to %_$1", 2, { 0, 0 } }, { "not_invited", "You have not been invited to a channel!", 0 }, diff --git a/src/fe-common/irc/module-formats.h b/src/fe-common/irc/module-formats.h index 75e84a4b..88980328 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_JOINERROR_DUPLICATE, IRCTXT_CHANNEL_REJOIN, IRCTXT_INVITING, IRCTXT_NOT_INVITED, |