Function: erc-sort-channel-users-by-activity

erc-sort-channel-users-by-activity is a byte-compiled function defined in erc.el.gz.

Signature

(erc-sort-channel-users-by-activity LIST)

Documentation

Sort LIST such that users which have spoken most recently are listed first.

LIST must be of the form (USER . CHANNEL-DATA).

See also: erc-get-channel-user-list.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc-sort-channel-users-by-activity (list)
  "Sort LIST such that users which have spoken most recently are listed first.
LIST must be of the form (USER . CHANNEL-DATA).

See also: `erc-get-channel-user-list'."
  (sort list
        (lambda (x y)
          (when (and (cdr x) (cdr y))
            (let ((tx (erc-channel-user-last-message-time (cdr x)))
                  (ty (erc-channel-user-last-message-time (cdr y))))
              (and tx
                   (or (not ty)
                       (time-less-p ty tx))))))))