From 681d35d8d292b34373ab07774475d5c5b4ff2c49 Mon Sep 17 00:00:00 2001 From: "silver%warwickcompsoc.co.uk" Date: Wed, 10 Mar 2004 04:32:15 +0000 Subject: [PATCH] Bug 165332 - Better error messages when joining a channel fails. r=samuel@sieb.net --- extensions/irc/xul/content/handlers.js | 9 +++++++++ extensions/irc/xul/locale/en-US/chatzilla.properties | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/extensions/irc/xul/content/handlers.js b/extensions/irc/xul/content/handlers.js index 777ff941c4a..7293100c8b3 100644 --- a/extensions/irc/xul/content/handlers.js +++ b/extensions/irc/xul/content/handlers.js @@ -606,6 +606,15 @@ function my_unknown (e) { e.params.shift(); /* remove the code */ e.params.shift(); /* and the dest. nick (always me) */ + + // Handle random IRC numerics automatically. + var msg = getMsg("msg.err.irc." + e.code, null, ""); + if (msg) + { + this.display(msg); + return; + } + /* if it looks like some kind of "end of foo" code, and we don't * already have a mapping for it, make one up */ var length = e.params.length; diff --git a/extensions/irc/xul/locale/en-US/chatzilla.properties b/extensions/irc/xul/locale/en-US/chatzilla.properties index 41300e5a34c..b096fe494e8 100644 --- a/extensions/irc/xul/locale/en-US/chatzilla.properties +++ b/extensions/irc/xul/locale/en-US/chatzilla.properties @@ -447,6 +447,12 @@ msg.err.no.match = No match for ``%S'' msg.err.no.socket = Error creating socket msg.err.exhausted = Connection attempts exhausted, giving up. +# Better IRC error messages +msg.err.irc.471 = This channel has reached it's set capacity; you connot join it. +msg.err.irc.473 = This channel is invite-only. You must have an invite from an existing member of the channel to join. +msg.err.irc.474 = You are banned from this channel. +msg.err.irc.475 = This channel needs a key. You must provide the correct key to join the channel. See "/help join" for details on joining a channel with a key. + msg.warn.unk.command = Unknown command ``%S'', just guessing. msg.val.on = on