1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Skip erc-ignored-user-p when erc-ignore-list is empty

* lisp/erc/erc-backend.el (erc-server-PRIVMSG): Don't bother running
`erc-ignored-user-p' and `erc-ignored-reply-p' when their associated
options are null.  The option `erc-ignore-list' is buffer-local when
set, and `erc-ignored-user-p' looks for it in the server buffer.
Moreover, all functions that set it, like `erc-cmd-IGNORE' and
`erc-cmd-UNIGNORE', do so in the server buffer.  And the response
handler in question only runs in server buffers, so this shouldn't
break anything.  Also, remove stray call to reassign trailing response
contents.
* lisp/erc/erc-common.el (erc-get-server-user): Rearrange so
`erc-with-server-buffer' doesn't have to switch to the server buffer
because `erc-downcase' can run in channels as well.
* lisp/erc/erc.el (erc-ignored-user-p): Add comment.  (Bug#67677)
This commit is contained in:
F. Jason Park 2023-09-11 21:21:42 -07:00
parent 7db500b50b
commit c1befaf0a8
3 changed files with 9 additions and 5 deletions

View file

@ -7718,6 +7718,8 @@ The previous default target of QUERY type gets removed."
(setq erc-default-recipients d2)
(error "Current target is not a QUERY"))))
;; FIXME move all ignore-related functionality to its own module,
;; required and enabled by default (until some major version change).
(defun erc-ignored-user-p (spec)
"Return non-nil if SPEC matches something in `erc-ignore-list'.