X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Friece-400.el;h=02ded58631fbbdcd035eb8b0b4785680619c0c6a;hb=c3c256533e44c81607a871fb1e6ee9914f4c58b8;hp=96816076cc7ea5509ad9974119c8f6547431f9e5;hpb=a7ae2b41f597d0facc806dc659ecb82a51ec0463;p=elisp%2Friece.git diff --git a/lisp/riece-400.el b/lisp/riece-400.el index 9681607..02ded58 100644 --- a/lisp/riece-400.el +++ b/lisp/riece-400.el @@ -19,16 +19,18 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Code: (require 'riece-globals) (require 'riece-misc) +(require 'riece-mcat) +(require 'riece-commands) (eval-when-compile - (autoload 'riece-default-handle-numeric-reply "riece-filter")) + (autoload 'riece-default-handle-numeric-reply "riece-handle")) (defun riece-handle-default-400-message (prefix number name string) (riece-default-handle-numeric-reply riece-error-prefix prefix number name string)) @@ -44,7 +46,7 @@ "ERR_ERRONEUSNICKNAME \" :Erroneous nickname\"." (let ((nickname (riece-handle-read-string - (format "Erroneous nickname \"%s\". Choose a new one: " + (format (riece-mcat "Erroneous nickname \"%s\". Choose a new one: ") (car (riece-split-parameters string)))))) (if nickname (riece-send-string (format "NICK %s\r\n" nickname))))) @@ -53,16 +55,35 @@ "ERR_NICKNAMEINUSE \" :Nickname is already in use\"." (let ((nickname (riece-handle-read-string - (format "Nickname \"%s\" already in use. Choose a new one: " + (format (riece-mcat "Nickname \"%s\" already in use. Choose a new one: ") (car (riece-split-parameters string)))))) (if nickname (riece-send-string (format "NICK %s\r\n" nickname))))) (defun riece-handle-464-message (prefix number name string) "ERR_PASSWDMISMATCH \":Password incorrect\"." - (message "Password incorrect from %s." prefix) + (message (riece-mcat "Password incorrect from %s.") prefix) (setq riece-reconnect-with-password t)) +(defun riece-handle-475-message (prefix number name string) + "ERR_BADCHANNELKEY \" :Cannot join channel (+k)\"." + (let* ((parameters (riece-split-parameters string)) + (channel-identity (riece-make-identity (car parameters) + riece-server-name)) + key) + (setq key + (condition-case nil + (let (inhibit-quit) + (riece-read-passwd + (format (riece-mcat "Key for %s: ") + (riece-format-identity channel-identity t)))) + (quit + (message (riece-mcat "Key for %s: Quit") + (riece-format-identity channel-identity t)) + 'quit))) + (unless (eq key 'quit) + (riece-command-join-channel channel-identity key)))) + (provide 'riece-400) ;;; riece-400.el ends here