Function: erc--process-channel-modes

erc--process-channel-modes is a byte-compiled function defined in erc.el.gz.

Signature

(erc--process-channel-modes STRING ARGS &optional STATUS-LETTERS)

Documentation

Parse channel "MODE" changes and call unary letter handlers.

Update erc-channel-modes and erc--channel-modes(var)/erc--channel-modes(fun). With STATUS-LETTERS, also update channel membership prefixes. Expect STRING to be the second argument from an incoming "MODE" command and ARGS to be the remaining arguments, which should complement relevant letters in STRING.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc--process-channel-modes (string args &optional status-letters)
  "Parse channel \"MODE\" changes and call unary letter handlers.
Update `erc-channel-modes' and `erc--channel-modes'.  With
STATUS-LETTERS, also update channel membership prefixes.  Expect
STRING to be the second argument from an incoming \"MODE\"
command and ARGS to be the remaining arguments, which should
complement relevant letters in STRING."
  (cl-assert (erc--target-channel-p erc--target))
  (let* ((obj (erc--channel-mode-types))
         (table (erc--channel-mode-types-table obj))
         (fallbackp (erc--channel-mode-types-fallbackp obj))
         (+p t))
    (erc--doarray (c string)
      (cond ((= ?+ c) (setq +p t))
            ((= ?- c) (setq +p nil))
            ((and status-letters (string-search (string c) status-letters))
             (erc--cusr-change-status (pop args) c +p))
            ((and-let* ((group (or (aref table c) (and fallbackp ?d))))
               (erc--handle-channel-mode group c +p
                                         (and (/= group ?d)
                                              (or (/= group ?c) +p)
                                              (pop args)))
               t))
            ((not fallbackp)
             (erc-display-message nil '(notice error) (erc-server-buffer)
                                  'channel-mode-unknown ?c (string c)))))
    (setq erc-channel-modes (sort erc-channel-modes #'string<))
    (setq erc--mode-line-mode-string
          (concat "+" (erc--channel-modes erc--mode-line-chanmodes-arg-len)))
    (erc-update-mode-line (current-buffer))))