+(defcustom gnus-server-unopen-status nil
+ "The default status if the server is not able to open.
+If the server is covered by Gnus agent, the possible values are
+`denied', set the server denied; `offline', set the server offline;
+nil, ask user. If the server is not covered by Gnus agent, set the
+server denied."
+ :version "22.1"
+ :group 'gnus-start
+ :type '(choice (const :tag "Ask" nil)
+ (const :tag "Deny server" denied)
+ (const :tag "Unplug Agent" offline)))
+
+(defvar gnus-internal-registry-spool-current-method nil
+ "The current method, for the registry.")
+
+
+(defun gnus-server-opened (gnus-command-method)
+ "Check whether a connection to GNUS-COMMAND-METHOD has been opened."
+ (unless (eq (gnus-server-status gnus-command-method)
+ 'denied)
+ (when (stringp gnus-command-method)
+ (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
+ (funcall (inline (gnus-get-function gnus-command-method 'server-opened))
+ (nth 1 gnus-command-method))))
+
+(defun gnus-status-message (gnus-command-method)
+ "Return the status message from GNUS-COMMAND-METHOD.
+If GNUS-COMMAND-METHOD is a string, it is interpreted as a group
+name. The method this group uses will be queried."
+ (let ((gnus-command-method
+ (if (stringp gnus-command-method)
+ (gnus-find-method-for-group gnus-command-method)
+ gnus-command-method)))
+ (funcall (gnus-get-function gnus-command-method 'status-message)
+ (nth 1 gnus-command-method))))
+