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

This function is for internal use only.

Update erc-channel-users according to NAMES-STRING. NAMES-STRING is a string listing some of the names on the channel.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc-channel-receive-names (names-string)
  "This function is for internal use only.

Update `erc-channel-users' according to NAMES-STRING.
NAMES-STRING is a string listing some of the names on the
channel."
  (let* ((prefix (erc-parse-prefix))
         (voice-ch (cdr (assq ?v prefix)))
         (op-ch (cdr (assq ?o prefix)))
         (hop-ch (cdr (assq ?h prefix)))
         (adm-ch (cdr (assq ?a prefix)))
         (own-ch (cdr (assq ?q prefix)))
         (names (delete "" (split-string names-string)))
	 name op voice halfop admin owner)
    (let ((erc-channel-members-changed-hook nil))
      (dolist (item names)
        (let ((updatep t)
	      (ch (aref item 0)))
          (setq name item op 'off voice 'off halfop 'off admin 'off owner 'off)
          (if (rassq ch prefix)
              (if (= (length item) 1)
		  (setq updatep nil)
		(setq name (substring item 1))
		(setf (pcase ch
			((pred (eq voice-ch)) voice)
			((pred (eq hop-ch))   halfop)
			((pred (eq op-ch))    op)
			((pred (eq adm-ch))   admin)
			((pred (eq own-ch))   owner)
			(_ (message "Unknown prefix char `%S'" ch) voice))
		      'on)))
          (when updatep
	    ;; 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 name) t
                     erc-channel-new-member-names)
            (erc-update-current-channel-member
             name name t voice halfop op admin owner)))))
    (run-hooks 'erc-channel-members-changed-hook)))