Function: erc-banlist-update

erc-banlist-update is a byte-compiled function defined in erc.el.gz.

This function is obsolete since 31.1; continual syncing via erc--banlist-update

Signature

(erc-banlist-update PROC PARSED)

Documentation

Check MODE commands for bans and update the banlist appropriately.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc-banlist-update (proc parsed)
  "Check MODE commands for bans and update the banlist appropriately."
  ;; FIXME: Possibly incorrect. -- Lawrence 2004-05-11
  (declare (obsolete "continual syncing via `erc--banlist-update'" "31.1"))
  (let* ((tgt (car (erc-response.command-args parsed)))
         (mode (erc-response.contents parsed))
         (whoset (erc-response.sender parsed))
         (buffer (erc-get-buffer tgt proc)))
    (when buffer
      (with-current-buffer buffer
        (cond ((not (get 'erc-channel-banlist 'received-from-server)) nil)
              ((string-match "^\\([+-]\\)b" mode)
               ;; This is a ban
               (cond
                ((string-match "^-" mode)
                 ;; Remove the unbanned masks from the ban list
                 (setq erc-channel-banlist
                       (cl-delete-if
                        (lambda (y)
                          (member (upcase (cdr y))
                                  (mapcar #'upcase
                                          (cdr (split-string mode)))))
                        erc-channel-banlist)))
                ((string-match "^\\+" mode)
                 ;; Add the banned mask(s) to the ban list
                 (mapc
                  (lambda (mask)
                    (unless (member (cons whoset mask) erc-channel-banlist)
                      (setq erc-channel-banlist
                            (cons (cons whoset mask) erc-channel-banlist))))
                  (cdr (split-string mode))))))))))
  nil)