]> git.eshelyaron.com Git - emacs.git/commit
Retain client's own user in erc-server-users
authorF. Jason Park <jp@neverwas.me>
Thu, 25 Apr 2024 12:16:23 +0000 (05:16 -0700)
committerEshel Yaron <me@eshelyaron.com>
Wed, 29 May 2024 10:11:52 +0000 (12:11 +0200)
commit979b806cff9e8d1e50975ab2bb255c127085a853
tree4c39783bc6db434baaac402613b55336a73e1a81
parent477c9cfacdb0bc79a035c4fb2514c86f67a5310e
Retain client's own user in erc-server-users

* lisp/erc/erc-backend.el (erc-server-KICK, erc-server-PART): Use new
function `erc--remove-channel-user-but' instead of
`erc-remove-channel-users'.  In `erc-server-KICK', remove sender's
channel membership data after displaying the message so that nicks are
buttonized.  Return nil.  In `erc-server-PART', don't run
`erc-remove-channel-member' when the client itself has parted.
* lisp/erc/erc-common.el (erc--remove-user-from-targets): New
function.
* lisp/erc/erc.el (erc-remove-server-user): Redo doc string.
(erc--forget-server-user-function): New variable.
(erc--forget-server-user): New function.
(erc--forget-server-user-ignoring-queries): New function, the default
value of `erc--forget-server-user-function'.
(erc-remove-channel-user): Defer to `erc--forget-server-user-function'
to do the actual removal.
(erc-remove-user): Defer to `erc--remove-user-from-targets'.
(erc-remove-channel-users): Redo doc
(erc--remove-channel-users-but): New function.  The only use case thus
far is for protecting the client's own `erc-server-users' entry from
removal when draining `erc-channel-members' tables after the client
leaves a target buffer or quits.
(erc-kill-buffer-function): Don't remove own user from
`erc-server-users'.
* test/lisp/erc/erc-scenarios-base-renick.el
(erc-scenarios-base-renick-queries-solo): Assert own client parting
its only channel doesn't remove own user from server.  Also assert
that another user parting their only channel removes them from all
queries.  (Bug#70928)

(cherry picked from commit 5f84213c9802181b4d800615915e3c8dded7b94f)
lisp/erc/erc-backend.el
lisp/erc/erc-common.el
lisp/erc/erc.el
test/lisp/erc/erc-scenarios-base-renick.el