mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
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)
This commit is contained in:
parent
04477cf97b
commit
5f84213c98
4 changed files with 93 additions and 45 deletions
|
|
@ -185,21 +185,43 @@
|
|||
(with-current-buffer (erc-d-t-wait-for 10 (get-buffer "Lal"))
|
||||
(funcall expect 10 "<Lal> hello")
|
||||
(erc-scenarios-common-say "hi")
|
||||
(should-not (erc-get-channel-member "tester"))
|
||||
(funcall expect 10 "is now known as Linguo")
|
||||
;; No duplicate message.
|
||||
(funcall expect -0.1 "is now known as Linguo")
|
||||
;; No duplicate buffer.
|
||||
(erc-d-t-wait-for 1 (equal (buffer-name) "Linguo"))
|
||||
(should-not (get-buffer "Lal"))
|
||||
;; Channel member has been updated
|
||||
(should-not (erc-get-channel-member "Lal"))
|
||||
(should-not (erc-get-server-user "Lal"))
|
||||
(should (erc-get-channel-member "Linguo"))
|
||||
(erc-scenarios-common-say "howdy Linguo")))
|
||||
|
||||
(with-current-buffer "#foo"
|
||||
(funcall expect 10 "is now known as Linguo")
|
||||
(funcall expect -0.1 "is now known as Linguo")
|
||||
(funcall expect 10 "has left"))
|
||||
|
||||
;; User parting a common channel removes them from queries.
|
||||
(with-current-buffer "Linguo"
|
||||
(should-not (erc-get-channel-member "tester"))
|
||||
(erc-d-t-wait-for 10 (null (erc-get-channel-member "Linguo")))
|
||||
(should-not (erc-get-server-user "Linguo")))
|
||||
|
||||
;; Leaving the client's only channel doesn't remove its user data
|
||||
;; from the server table (see below, after "get along ...").
|
||||
(with-current-buffer "#foo"
|
||||
(erc-scenarios-common-say "/part"))
|
||||
|
||||
;; Server and "channel" user are *not* (re)created upon receiving
|
||||
;; a direct message for a user we already have an open query with
|
||||
;; but with whom we no longer share a channel.
|
||||
(with-current-buffer "Linguo"
|
||||
(funcall expect 10 "get along"))))
|
||||
(funcall expect 10 "get along")
|
||||
(should-not (erc-get-channel-member "Linguo"))
|
||||
(should-not (erc-get-channel-member "tester"))
|
||||
(should (erc-get-server-user "tester")))))
|
||||
|
||||
;; Someone you have a query with disconnects and reconnects under a
|
||||
;; new nick (perhaps due to their client appending a backtick or
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue