Function: erc--remove-channel-users-but

erc--remove-channel-users-but is a byte-compiled function defined in erc.el.gz.

Signature

(erc--remove-channel-users-but NICK)

Documentation

Drain channel users and remove from server, sparing NICK.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc--remove-channel-users-but (nick)
  "Drain channel users and remove from server, sparing NICK."
  (when-let* ((users (erc-with-server-buffer erc-server-users))
              (my-user (gethash (erc-downcase nick) users))
              (original-function erc--forget-server-user-function)
              (erc--forget-server-user-function
               (if erc--decouple-query-and-channel-membership-p
                   erc--forget-server-user-function
                 (lambda (nick user)
                   (unless (eq user my-user)
                     (funcall original-function nick user))))))
    (erc-remove-channel-users)))