Function: erc-set-initial-user-mode

erc-set-initial-user-mode is a byte-compiled function defined in erc.el.gz.

Signature

(erc-set-initial-user-mode NICK BUFFER)

Documentation

If erc-user-mode is non-nil for NICK, set the user modes.

The server buffer is given by BUFFER.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc-set-initial-user-mode (nick buffer)
  "If `erc-user-mode' is non-nil for NICK, set the user modes.
The server buffer is given by BUFFER."
  (with-current-buffer buffer
    (when erc-user-mode
      (let* ((mode (if (functionp erc-user-mode)
                       (funcall erc-user-mode)
                     erc-user-mode))
             (groups (erc--parse-user-modes mode (erc--user-modes) t))
             (superfluous (last groups 2))
             (redundant-want (car superfluous))
             (redundant-drop (cadr superfluous)))
        (when redundant-want
          (erc-display-message nil 'notice buffer 'user-mode-redundant-add
                               ?m (apply #'string redundant-want)))
        (when redundant-drop
          (erc-display-message nil 'notice buffer 'user-mode-redundant-drop
                               ?m (apply #'string redundant-drop)))
        (when (stringp mode)
          (erc-log (format "changing mode for %s to %s" nick mode))
          (erc-server-send (format "MODE %s %s" nick mode)))))))