(unless (listp liece-server)
(let ((entry (assoc liece-server liece-server-alist)))
(if entry
- (setq liece-server (cdr entry)))
- (setq liece-server
- (let ((plist (liece-server-parse-string liece-server)))
- (unless entry
- (set-alist 'liece-server-alist liece-server plist)
- (setq liece-save-variables-are-dirty t))
- plist))))
+ (if (listp (cdr entry))
+ (setq liece-server (cdr entry))
+ (setq liece-server (liece-server-parse-string (cdr entry))))
+ (let ((plist (liece-server-parse-string liece-server)))
+ (set-alist 'liece-server-alist liece-server plist)
+ (setq liece-save-variables-are-dirty t)
+ (setq liece-server plist)))))
(when (or (and confirm liece-ask-for-nickname)
(null liece-nickname))
(setq liece-nickname (read-string (_ "Enter your nickname: ") liece-nickname)))
(if (and (memq type '(rlogin telnet)) relay)
(setq liece-tcp-relay-host relay))
(setq liece-tmp-server-name host)
- (liece-open-server-internal host service type)
+ (unless (string-match "^[^\\[]" host)
+ (setq host (substring host 1 (1- (length host)))))
+ (setq liece-server-process (liece-open-server-internal host service type))
(setq liece-after-registration nil)
(liece-maybe-poll)
(if (null (liece-wait-for-response "^:[^ ]+ [4P][5O][1N][ G]"))
(defun liece-open-server-internal (host &optional service type)
"Open connection to chat server on HOST by SERVICE (default is irc).
Optional argument TYPE specifies connection types such as `program'."
- ;; canonicalize host representation
- (unless (string-match "^[^\\[]" host)
- (setq host (substring host 1 (1- (length host)))))
- (condition-case error
- (save-excursion
- (let ((liece-tcp-connection-type type))
- (as-binary-process
- (setq liece-server-process
- (liece-open-network-stream
- "IRC" " *IRC*" host (or service "irc"))))
- (setq liece-server-buffer (process-buffer liece-server-process))
- (set-buffer liece-server-buffer)
- (set-buffer-multibyte nil)
- (kill-all-local-variables)
- (buffer-disable-undo)
- (erase-buffer)
- (setq liece-server-name host)
- (run-hooks 'liece-server-hook)
- ;; return the server process
- liece-server-process))
- (error
- (setq liece-status-message-string (cadr error)
- liece-server-process nil))))
+ (let ((liece-tcp-connection-type type)
+ process)
+ (as-binary-process
+ (setq process
+ (liece-open-network-stream
+ "IRC" " *IRC*" host (or service "irc"))))
+ (setq liece-server-buffer (process-buffer process))
+ (save-excursion
+ (set-buffer liece-server-buffer)
+ (set-buffer-multibyte nil)
+ (kill-all-local-variables)
+ (buffer-disable-undo)
+ (erase-buffer))
+ process))
(defun liece-initialize-timers ()
"Initialise internal timers."