Function: erc-autoaway-possibly-set-away

erc-autoaway-possibly-set-away is a byte-compiled function defined in erc-autoaway.el.gz.

Signature

(erc-autoaway-possibly-set-away CURRENT-TIME)

Documentation

Set autoaway when erc-auto-set-away is true and the idletime is exceeds erc-autoaway-idle-seconds.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-autoaway.el.gz
(defun erc-autoaway-possibly-set-away (current-time)
  "Set autoaway when `erc-auto-set-away' is true and the idletime is
exceeds `erc-autoaway-idle-seconds'."
  ;; A test for (erc-server-process-alive) is not necessary, because
  ;; this function is called from `erc-timer-hook', which is called
  ;; whenever the server sends something to the client.
  (when (and erc-server-connected
	     erc-auto-set-away
	     (not erc-autoaway-caused-away)
	     (erc-autoaway-some-open-server-buffer))
    (let ((idle-time (erc-time-diff erc-autoaway-last-sent-time
				    current-time)))
      (when (>= idle-time erc-autoaway-idle-seconds)
	(erc-display-message
	 nil 'notice nil
	 (format "Setting automatically away after %i seconds of idle-time"
		 idle-time))
	(erc-autoaway-set-away idle-time t)))))