Function: erc-update-current-channel-member

erc-update-current-channel-member is a byte-compiled function defined in erc.el.gz.

Signature

(erc-update-current-channel-member NICK NEW-NICK &optional ADDP VOICE HALFOP OP ADMIN OWNER HOST LOGIN FULL-NAME INFO UPDATE-MESSAGE-TIME)

Documentation

Update or create entry for NICK in current erc-channel-members table.

With ADDP, ensure an entry exists. When an entry does exist or when ADDP is non-nil and an erc-server-users entry already exists, call erc-update-user with NEW-NICK, HOST, LOGIN, FULL-NAME, and INFO. Expect any non-nil membership status switches among VOICE, HALFOP, OP, ADMIN, and OWNER to be the symbol on or off when needing to influence a new or existing erc-channel-user object's status slot. Likewise, when UPDATE-MESSAGE-TIME is non-nil, update or initialize the last-message-time slot to the current-time. If changes occur, including creation, run erc-channel-members-changed-hook. Return non-nil when meaningful changes, including creation, have occurred.

Without ADDP, do nothing unless a erc-channel-members entry exists. When it doesn't, assume the sender is a non-joined entity, like the server itself or a historical speaker, or assume the prior buffer for the channel was killed without parting.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc-update-current-channel-member
    (nick new-nick &optional addp voice halfop op admin owner host login
          full-name info update-message-time)
  "Update or create entry for NICK in current `erc-channel-members' table.
With ADDP, ensure an entry exists.  When an entry does exist or
when ADDP is non-nil and an `erc-server-users' entry already
exists, call `erc-update-user' with NEW-NICK, HOST, LOGIN,
FULL-NAME, and INFO.  Expect any non-nil membership
status switches among VOICE, HALFOP, OP, ADMIN, and OWNER to be
the symbol `on' or `off' when needing to influence a new or
existing `erc-channel-user' object's `status' slot.  Likewise,
when UPDATE-MESSAGE-TIME is non-nil, update or initialize the
`last-message-time' slot to the `current-time'.  If changes occur,
including creation, run `erc-channel-members-changed-hook'.
Return non-nil when meaningful changes, including creation, have
occurred.

Without ADDP, do nothing unless a `erc-channel-members' entry
exists.  When it doesn't, assume the sender is a non-joined
entity, like the server itself or a historical speaker, or assume
the prior buffer for the channel was killed without parting."
(let* ((cmem (erc-get-channel-member nick))
       (status (and (or voice halfop op admin owner)
                    (if cmem
                        (erc--compute-cusr-fallback-status
                         (erc-channel-user-status (cdr cmem))
                         voice halfop op admin owner)
                      (erc--init-cusr-fallback-status
                       (and voice  (eq voice  'on))
                       (and halfop (eq halfop 'on))
                       (and op     (eq op     'on))
                       (and admin  (eq admin  'on))
                       (and owner  (eq owner  'on)))))))
  (if cmem
      (erc--update-current-channel-member cmem status update-message-time
                                          new-nick host login
                                          full-name info)
    (when addp
      (erc--create-current-channel-member nick status update-message-time
                                          new-nick host login
                                          full-name info)))))