(let ((hook (intern (concat "liece-" message "-hook")))
(after-hook (intern (concat "liece-after-" message "-hook")))
(number (car (read-from-string message)))
- func)
- (if (condition-case nil
- (run-hook-with-args-until-success hook prefix line)
- (error nil))
+ function)
+ (if (run-hook-with-args-until-success hook prefix line)
(return-from liece-handle-message))
-
- (cond
- ((numberp number)
- (let* ((base (/ number 100))
- (backend (format "liece-%d00" base)))
- (or (eval `(featurep ',(intern backend)))
- (load backend t))
- (setq func (liece-handler-find-function message '(prefix line)
- (format "%d00" base)))
- (if func
- (funcall func prefix line)
- (funcall (symbol-function (intern
- (format "liece-handle-%d00-messages"
- base)))
- message prefix line))))
- (t
- (setq func (liece-handler-find-function
- message '(prefix line) "generic"))
- (if func
- (funcall func prefix line))))
-
- (ignore-errors (run-hook-with-args after-hook prefix line))))
+ (if (not (numberp number))
+ (setq function (liece-handler-find-function message '(prefix line) "generic"))
+ (let ((base (format "%03d" (- number (mod number 100)))))
+ (require (intern (concat "liece-" base)) nil 'noerror)
+ (setq function (liece-handler-find-function message '(prefix line) base))
+ (or function
+ (setq function
+ (let ((default (concat "liece-handle-" base "-messages")))
+ `(lambda (prefix line)
+ (funcall (intern ,default) ,message prefix line)))))))
+ (if function
+ (funcall function prefix line))
+ (run-hook-with-args after-hook prefix line)))
(defun liece-parse-user-at-host ()
(let ((cookie
(liece-sentinel-error proc status)
(liece-message (_ "Connection closed. (%s)")
(substring status 0 (1- (length status)))))
- (liece-clear-system))
+ (liece-close-server))
(liece-reconnect-with-password
(liece))
(t