Function: erc-channel-receive-names

erc-channel-receive-names is a byte-compiled function defined in erc.el.gz.

Signature

(erc-channel-receive-names NAMES-STRING)

Documentation

Update erc-channel-members from NAMES-STRING.

Expect NAMES-STRING to resemble the trailing argument of a 353 RPL_NAMREPLY. Call internal handlers for parsing individual names, whose expected composition may differ depending on enabled extensions.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc-channel-receive-names (names-string)
  "Update `erc-channel-members' from NAMES-STRING.
Expect NAMES-STRING to resemble the trailing argument of a 353
RPL_NAMREPLY.  Call internal handlers for parsing individual
names, whose expected composition may differ depending on enabled
extensions."
  (let ((names (delete "" (split-string names-string)))
        (erc-channel-members-changed-hook nil))
    (dolist (name names)
      (when-let ((args (erc--partition-prefixed-names name)))
        (pcase-let* ((`(,status ,nick ,login ,host) args)
                     (cmem (erc-get-channel-user nick)))
          (progn
	    ;; If we didn't issue the NAMES request (consider two clients
	    ;; talking to an IRC proxy), `erc-channel-begin-receiving-names'
	    ;; will not have been called, so we have to do it here.
	    (unless erc-channel-new-member-names
	      (erc-channel-begin-receiving-names))
            (puthash (erc-downcase nick) t erc-channel-new-member-names)
            (if cmem
                (erc--update-current-channel-member cmem status nil
                                                    nick host login)
              (erc--create-current-channel-member nick status nil
                                                  nick host login)))))))
  (run-hooks 'erc-channel-members-changed-hook))