diff --git a/chat/locales/en-US/irc.properties b/chat/locales/en-US/irc.properties index f78c9722d7..544ca7d27e 100644 --- a/chat/locales/en-US/irc.properties +++ b/chat/locales/en-US/irc.properties @@ -148,7 +148,7 @@ message.ping=Ping reply from %1$S in #2 millisecond.;Ping reply from %1$S in #2 # LOCALIZATION NOTE (error.*): -# These are shown as error messages in the server tab. +# These are shown as error messages in the conversation or server tab. # %S is the channel name. error.noChannel=There is no channel: %S. error.tooManyChannels=Cannot join %S; you've joined too many channels. @@ -173,6 +173,9 @@ error.notChannelOp=You are not a channel operator on %S. error.notChannelOwner=You are not a channel owner of %S. error.wrongKey=Cannot join %S, invalid channel password. error.sendMessageFailed=An error occurred while sending your last message. Please try again once the connection has been reestablished. +# %1$S is the channel the user tried to join, %2$S is the channel +# he was forwarded to. +error.channelForward=You may not join %1$S, and were automatically redirected to %2$S. # LOCALIZATION NOTE (tooltip.*): # These are the descriptions given in a tooltip with information received diff --git a/chat/protocols/irc/ircNonStandard.jsm b/chat/protocols/irc/ircNonStandard.jsm index 14a7a9f7a3..5b5d275bec 100644 --- a/chat/protocols/irc/ircNonStandard.jsm +++ b/chat/protocols/irc/ircNonStandard.jsm @@ -175,6 +175,17 @@ var ircNonStandard = { aMessage.params[1] == "Password required"; }, + "470": function(aMessage) { // Channel forward (Unreal, inspircd) + // : You may not join this channel, + // so you are automatically being transferred to the redirect channel. + // Join redirect channel so when the automatic join happens, we are + // not surprised. + this.joinChat(this.getChatRoomDefaultFieldValues(aMessage.params[2])); + // Mark requested channel as left and add a system message. + return conversationErrorMessage(this, aMessage, "error.channelForward", + true, false); + }, + "499": function(aMessage) { // ERR_CHANOWNPRIVNEEDED (Unreal) // :You're not the channel owner (status +q is needed) return conversationErrorMessage(this, aMessage, "error.notChannelOwner"); diff --git a/chat/protocols/irc/ircUtils.jsm b/chat/protocols/irc/ircUtils.jsm index 495dd2fb5e..63582a9ed8 100644 --- a/chat/protocols/irc/ircUtils.jsm +++ b/chat/protocols/irc/ircUtils.jsm @@ -221,7 +221,8 @@ function mIRCColoring(aStack, aInput) { function conversationErrorMessage(aAccount, aMessage, aError, aJoinFailed = false, aRejoinable = true) { let conv = aAccount.getConversation(aMessage.params[1]); - conv.writeMessage(aMessage.origin, _(aError, aMessage.params[1]), + conv.writeMessage(aMessage.origin, _(aError, aMessage.params[1], + aMessage.params[2] || undefined), {error: true, system: true}); delete conv._pendingMessage;