X-Git-Url: https://cgit.sxemacs.org/?p=riece;a=blobdiff_plain;f=lisp%2Friece-server.el;h=9ee0e905b4a43c062a588c9499b8ae1cb9046e05;hp=99a1a073eaa5455cdf91cf5af727087e7b522465;hb=9a40faf27d1ddc378072d9a78dae747f44fc757a;hpb=91f37fc73a88f27387e62b4a8381219ae35e5f75 diff --git a/lisp/riece-server.el b/lisp/riece-server.el index 99a1a07..9ee0e90 100644 --- a/lisp/riece-server.el +++ b/lisp/riece-server.el @@ -72,7 +72,7 @@ the `riece-server-keyword-map' variable." plist) (setq plist (cons `(:host ,host) plist)) (unless (equal service "") - (setq plist (cons `(:service ,(string-to-int service)) plist))) + (setq plist (cons `(:service ,(string-to-number service)) plist))) (unless (equal password "") (setq plist (cons `(:password ,(substring password 1)) plist))) (apply #'nconc plist)))) @@ -171,12 +171,12 @@ the `riece-server-keyword-map' variable." (when (<= riece-send-size riece-max-send-size) (process-send-string process string) (setq riece-last-send-time (current-time))))) - (if riece-send-queue - (riece-run-at-time riece-send-delay nil - (lambda (process) - (if (process-live-p process) - (riece-flush-send-queue process))) - process))))) + (unless (riece-queue-empty riece-send-queue) + (riece-run-at-time riece-send-delay nil + (lambda (process) + (if (riece-server-process-opened process) + (riece-flush-send-queue process))) + process))))) (defun riece-process-send-string (process string) (with-current-buffer (process-buffer process) @@ -259,13 +259,17 @@ the `riece-server-keyword-map' variable." (setq riece-send-size 0) (make-local-variable 'riece-last-send-time) (setq riece-last-send-time '(0 0 0)) - (make-local-variable 'riece-obarray) - (setq riece-obarray (make-vector riece-obarray-size 0)) + (make-local-variable 'riece-user-obarray) + (setq riece-user-obarray (make-vector riece-user-obarray-size 0)) + (make-local-variable 'riece-channel-obarray) + (setq riece-channel-obarray (make-vector riece-channel-obarray-size 0)) (make-local-variable 'riece-coding-system) (buffer-disable-undo) (erase-buffer))) (defun riece-close-server-process (process) + (with-current-buffer (process-buffer process) + (run-hooks 'riece-after-close-hook)) (kill-buffer (process-buffer process)) (setq riece-server-process-alist (delq (rassq process riece-server-process-alist) @@ -286,6 +290,15 @@ the `riece-server-keyword-map' variable." (throw 'found t)) (setq alist (cdr alist))))))) +(defun riece-server-properties (server-name) + "Return a list of properties associated with SERVER-NAME." + (if (equal server-name "") + riece-server + (let ((entry (assoc server-name riece-server-alist))) + (unless entry + (error "No such server")) + (cdr entry)))) + (provide 'riece-server) ;;; riece-server.el ends here