X-Git-Url: http://cgit.sxemacs.org/?p=riece;a=blobdiff_plain;f=lisp%2Friece-server.el;h=89e923750a8a3ddfd07d399527e3e7719e0b7573;hp=25d67a4a6565a9c897d41d2992fb53e0c4217ea9;hb=53e1d0d718ed682c592503493c68f1f5062f1cae;hpb=a9b170f31e6f1c743d3527cd90694c86a6db9e52 diff --git a/lisp/riece-server.el b/lisp/riece-server.el index 25d67a4..89e9237 100644 --- a/lisp/riece-server.el +++ b/lisp/riece-server.el @@ -125,29 +125,36 @@ the `riece-server-keyword-map' variable." (riece-process-send-string process string))) (defun riece-open-server (server server-name) - (if (equal server-name "") - (message "Connecting to IRC server...") - (message "Connecting to %s..." server-name)) (riece-server-keyword-bind server - (let* (selective-display - (coding-system-for-read 'binary) - (coding-system-for-write 'binary) - (process + (let (selective-display + (coding-system-for-read 'binary) + (coding-system-for-write 'binary) + process) + (if (equal server-name "") + (message "Connecting to IRC server...") + (message "Connecting to %s..." server-name)) + (setq process (funcall function (riece-server-process-name server-name) (concat " *IRC*" server-name) - host service))) + host service)) + (if (equal server-name "") + (message "Connecting to IRC server...done") + (message "Connecting to %s...done" server-name)) (riece-reset-process-buffer process) (with-current-buffer (process-buffer process) (setq riece-server-name server-name)) (set-process-sentinel process 'riece-sentinel) (set-process-filter process 'riece-filter) - (if (or password - riece-reconnect-with-password) + (if (equal server-name "") + (message "Logging in to IRC server...") + (message "Logging in to %s..." server-name)) + (if riece-reconnect-with-password ;password incorrect or not set. + (unwind-protect + (setq password (riece-read-passwd "Password: ")) + (setq riece-reconnect-with-password nil))) + (if password (riece-process-send-string process - (format "PASS %s\r\n" - (or password - (riece-read-passwd - "Password: "))))) + (format "PASS %s\r\n" password))) (riece-process-send-string process (format "USER %s * * :%s\r\n" (user-real-login-name) @@ -159,10 +166,7 @@ the `riece-server-keyword-map' variable." riece-nick-accepted 'sent riece-coding-system coding)) (setq riece-process-list - (cons process riece-process-list)))) - (if (equal server-name "") - (message "Connecting to IRC server...done") - (message "Connecting to %s...done" server-name))) + (cons process riece-process-list))))) (defun riece-reset-process-buffer (process) (save-excursion @@ -207,7 +211,7 @@ the `riece-server-keyword-map' variable." (run-at-time riece-quit-timeout nil (lambda (process) (if (memq process riece-process-list) - (kill-process (process-buffer process)))) + (riece-close-server-process process))) process) (riece-process-send-string process (if message