#'rcirc-reconnect process t))))))))
(defun rcirc-sentinel (process sentinel)
- "Called when PROCESS receives SENTINEL."
- (let ((sentinel (string-replace "\n" "" sentinel)))
+ "Called on a change of the state of PROCESS.
+SENTINEL describes the change in form of a string."
+ (let ((status (process-status process)))
(rcirc-debug process (format "SENTINEL: %S %S\n" process sentinel))
(with-rcirc-process-buffer process
(cond
- ((string= sentinel "open")
+ ((eq status 'open)
(let* ((server (nth 0 rcirc-connection-info))
(user-name (nth 3 rcirc-connection-info))
(full-name (nth 4 rcirc-connection-info))
(dolist (buffer (cons nil (mapcar 'cdr rcirc-buffer-alist)))
(with-current-buffer (or buffer (current-buffer))
(setq mode-line-process nil)))))
- ((string= sentinel "deleted")
+ ((eq status 'closed)
(let ((now (current-time)))
(with-rcirc-process-buffer process
(when (and (< 0 rcirc-reconnect-delay)
(time-subtract now rcirc-last-connect-time)))
(setq rcirc-last-connect-time now)
(rcirc-reconnect process)))))
- ((dolist (buffer (cons nil (mapcar 'cdr rcirc-buffer-alist)))
+ ((eq status 'failed)
+ (dolist (buffer (cons nil (mapcar 'cdr rcirc-buffer-alist)))
(with-current-buffer (or buffer (current-buffer))
(rcirc-print process "*rcirc*" "ERROR" rcirc-target
(format "%s: %s (%S)"