Subject: Re: bug#42977: 28.0.50; New gnus-dbus library providing (optional) D-Bus->Gnus integration

From: Lars Ingebrigtsen <[email-masked]>
Date: Tue, 25 Aug 2020 21:21:42 +0200

Eric Abrahamsen <[email-masked]> writes:

> Okay, there it goes. This was made a tiny bit more difficult to test by
> the fact that the 'closed status (in `gnus-opened-servers') is set at
> various calling sites, and not centrally in `gnus-close-server'.
> `gnus-open-server' sets the 'open status, it seems like
> `gnus-close-server' should do the equivalent. I could take it out of
> `gnus-group-suspend', and look at whether `gnus-server-set-status' was
> really necessary.

I think the use case is stuff like this:

(defun gnus-agent-toggle-group-plugged (group)
  "Toggle the status of the server of the current group."
  (interactive (list (gnus-group-group-name)))
  (let* ((method (gnus-find-method-for-group group))
	 (status (cadr (assoc method gnus-opened-servers))))
    (if (eq status 'offline)
	(gnus-server-set-status method 'closed)
      (gnus-close-server method)
      (gnus-server-set-status method 'offline))

Where we close the server (i.e., the backends close the network
connections), but don't set the status to 'closed, because it's still
open on the Gnus side.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no