1 ;;; gnus-int.el --- backend interface functions for Gnus
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
4 ;; 2005 Free Software Foundation, Inc.
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
7 ;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 2, or (at your option)
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 ;; Boston, MA 02110-1301, USA.
31 (eval-when-compile (require 'cl))
37 (autoload 'gnus-agent-expire "gnus-agent")
38 (autoload 'gnus-agent-regenerate-group "gnus-agent")
39 (autoload 'gnus-agent-read-servers-validate-native "gnus-agent")
41 (defcustom gnus-open-server-hook nil
42 "Hook called just before opening connection to the news server."
46 (defcustom gnus-server-unopen-status nil
47 "The default status if the server is not able to open.
48 If the server is covered by Gnus agent, the possible values are
49 `denied', set the server denied; `offline', set the server offline;
50 nil, ask user. If the server is not covered by Gnus agent, set the
54 :type '(choice (const :tag "Ask" nil)
55 (const :tag "Deny server" denied)
56 (const :tag "Unplug Agent" offline)))
58 (defvar gnus-internal-registry-spool-current-method nil
59 "The current method, for the registry.")
62 ;;; Server Communication
65 (defun gnus-start-news-server (&optional confirm)
66 "Open a method for getting news.
67 If CONFIRM is non-nil, the user will be asked for an NNTP server."
69 (if gnus-current-select-method
70 ;; Stream is already opened.
73 (unless gnus-nntp-service
74 (setq gnus-nntp-server nil))
76 ;; Read server name with completion.
77 (setq gnus-nntp-server
78 (completing-read "NNTP server: "
80 (cons (list gnus-nntp-server)
81 gnus-secondary-servers))
82 nil nil gnus-nntp-server)))
84 (when (and gnus-nntp-server
85 (stringp gnus-nntp-server)
86 (not (string= gnus-nntp-server "")))
87 (setq gnus-select-method
88 (cond ((or (string= gnus-nntp-server "")
89 (string= gnus-nntp-server "::"))
90 (list 'nnspool (system-name)))
91 ((string-match "^:" gnus-nntp-server)
92 (list 'nnmh gnus-nntp-server
94 (file-name-as-directory
96 (substring gnus-nntp-server 1) "~/")))
97 (list 'nnmh-get-new-mail nil)))
99 (list 'nntp gnus-nntp-server)))))
101 (setq how (car gnus-select-method))
105 (gnus-message 5 "Looking up local news spool..."))
108 (gnus-message 5 "Looking up mh spool..."))
111 (setq gnus-current-select-method gnus-select-method)
112 (gnus-run-hooks 'gnus-open-server-hook)
114 ;; Partially validate agent covered methods now that the
115 ;; gnus-select-method is known.
118 ;; NOTE: This is here for one purpose only. By validating
119 ;; the current select method, it converts the old 5.10.3,
120 ;; and earlier, format to the current format. That enables
121 ;; the agent code within gnus-open-server to function
123 (gnus-agent-read-servers-validate-native gnus-select-method))
126 ;; gnus-open-server-hook might have opened it
127 (gnus-server-opened gnus-select-method)
128 (gnus-open-server gnus-select-method)
132 "%s (%s) open error: '%s'. Continue? "
133 (car gnus-select-method) (cadr gnus-select-method)
134 (gnus-status-message gnus-select-method)))
135 (gnus-error 1 "Couldn't open server on %s"
136 (nth 1 gnus-select-method))))))
138 (defun gnus-check-group (group)
139 "Try to make sure that the server where GROUP exists is alive."
140 (let ((method (gnus-find-method-for-group group)))
141 (or (gnus-server-opened method)
142 (gnus-open-server method))))
144 (defun gnus-check-server (&optional method silent)
145 "Check whether the connection to METHOD is down.
146 If METHOD is nil, use `gnus-select-method'.
147 If it is down, start it up (again)."
148 (let ((method (or method gnus-select-method))
150 ;; Transform virtual server names into select methods.
151 (when (stringp method)
152 (setq method (gnus-server-to-method method)))
153 (if (gnus-server-opened method)
154 ;; The stream is already opened.
158 (gnus-message 5 "Opening %s server%s..." (car method)
159 (if (equal (nth 1 method) "") ""
160 (format " on %s" (nth 1 method)))))
161 (gnus-run-hooks 'gnus-open-server-hook)
164 (setq result (gnus-open-server method))
165 (quit (message "Quit gnus-check-server")
168 (gnus-message 5 "Opening %s server%s...%s" (car method)
169 (if (equal (nth 1 method) "") ""
170 (format " on %s" (nth 1 method)))
171 (if result "done" "failed")))))))
173 (defun gnus-get-function (method function &optional noerror)
174 "Return a function symbol based on METHOD and FUNCTION."
175 ;; Translate server names into methods.
177 (error "Attempted use of a nil select method"))
178 (when (stringp method)
179 (setq method (gnus-server-to-method method)))
180 ;; Check cache of constructed names.
181 (let* ((method-sym (if gnus-agent
182 (inline (gnus-agent-get-function method))
184 (method-fns (get method-sym 'gnus-method-functions))
185 (func (let ((method-fnlist-elt (assq function method-fns)))
186 (unless method-fnlist-elt
187 (setq method-fnlist-elt
189 (intern (format "%s-%s" method-sym function))))
190 (put method-sym 'gnus-method-functions
191 (cons method-fnlist-elt method-fns)))
192 (cdr method-fnlist-elt))))
193 ;; Maybe complain if there is no function.
194 (unless (fboundp func)
196 (error "Trying to require a method that doesn't exist"))
197 (require (car method))
198 (when (not (fboundp func))
201 (error "No such function: %s" func))))
206 ;;; Interface functions to the backends.
209 (defun gnus-open-server (gnus-command-method)
210 "Open a connection to GNUS-COMMAND-METHOD."
211 (when (stringp gnus-command-method)
212 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
213 (let ((elem (assoc gnus-command-method gnus-opened-servers)))
214 ;; If this method was previously denied, we just return nil.
215 (if (eq (nth 1 elem) 'denied)
217 (gnus-message 1 "Denied server")
220 (let* ((open-server-function (gnus-get-function gnus-command-method 'open-server))
223 (funcall open-server-function
224 (nth 1 gnus-command-method)
225 (nthcdr 2 gnus-command-method))
227 (gnus-message 1 (format
228 "Unable to open server due to: %s"
229 (error-message-string err)))
232 (gnus-message 1 "Quit trying to open server")
235 ;; If this hasn't been opened before, we add it to the list.
237 (setq elem (list gnus-command-method nil)
238 gnus-opened-servers (cons elem gnus-opened-servers)))
239 ;; Set the status of this server.
242 (if (eq open-server-function #'nnagent-open-server)
243 ;; The agent's backend has a "special" status
247 (gnus-agent-method-p gnus-command-method))
248 (cond (gnus-server-unopen-status
249 ;; Set the server's status to the unopen
250 ;; status. If that status is offline,
251 ;; recurse to open the agent's backend.
252 (setq open-offline (eq gnus-server-unopen-status 'offline))
253 gnus-server-unopen-status)
255 (format "Unable to open %s:%s, go offline? "
256 (car gnus-command-method)
257 (cadr gnus-command-method)))
258 (setq open-offline t)
261 ;; This agentized server was still denied
264 ;; This unagentized server must be denied
267 ;; NOTE: I MUST set the server's status to offline before this
268 ;; recursive call as this status will drive the
269 ;; gnus-get-function (called above) to return the agent's
272 ;; Recursively open this offline server to perform the
273 ;; open-server function of the agent's backend.
274 (let ((gnus-server-unopen-status 'denied))
275 ;; Bind gnus-server-unopen-status to avoid recursively
276 ;; prompting with "go offline?". This is only a concern
277 ;; when the agent's backend fails to open the server.
278 (gnus-open-server gnus-command-method))
281 (defun gnus-close-server (gnus-command-method)
282 "Close the connection to GNUS-COMMAND-METHOD."
283 (when (stringp gnus-command-method)
284 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
285 (funcall (gnus-get-function gnus-command-method 'close-server)
286 (nth 1 gnus-command-method)))
288 (defun gnus-request-list (gnus-command-method)
289 "Request the active file from GNUS-COMMAND-METHOD."
290 (when (stringp gnus-command-method)
291 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
292 (funcall (gnus-get-function gnus-command-method 'request-list)
293 (nth 1 gnus-command-method)))
295 (defun gnus-request-list-newsgroups (gnus-command-method)
296 "Request the newsgroups file from GNUS-COMMAND-METHOD."
297 (when (stringp gnus-command-method)
298 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
299 (funcall (gnus-get-function gnus-command-method 'request-list-newsgroups)
300 (nth 1 gnus-command-method)))
302 (defun gnus-request-newgroups (date gnus-command-method)
303 "Request all new groups since DATE from GNUS-COMMAND-METHOD."
304 (when (stringp gnus-command-method)
305 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
306 (let ((func (gnus-get-function gnus-command-method 'request-newgroups t)))
308 (funcall func date (nth 1 gnus-command-method)))))
310 (defun gnus-server-opened (gnus-command-method)
311 "Check whether a connection to GNUS-COMMAND-METHOD has been opened."
312 (unless (eq (gnus-server-status gnus-command-method)
314 (when (stringp gnus-command-method)
315 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
316 (funcall (inline (gnus-get-function gnus-command-method 'server-opened))
317 (nth 1 gnus-command-method))))
319 (defun gnus-status-message (gnus-command-method)
320 "Return the status message from GNUS-COMMAND-METHOD.
321 If GNUS-COMMAND-METHOD is a string, it is interpreted as a group
322 name. The method this group uses will be queried."
323 (let ((gnus-command-method
324 (if (stringp gnus-command-method)
325 (gnus-find-method-for-group gnus-command-method)
326 gnus-command-method)))
327 (funcall (gnus-get-function gnus-command-method 'status-message)
328 (nth 1 gnus-command-method))))
330 (defun gnus-request-regenerate (gnus-command-method)
331 "Request a data generation from GNUS-COMMAND-METHOD."
332 (when (stringp gnus-command-method)
333 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
334 (funcall (gnus-get-function gnus-command-method 'request-regenerate)
335 (nth 1 gnus-command-method)))
337 (defun gnus-request-group (group &optional dont-check gnus-command-method)
338 "Request GROUP. If DONT-CHECK, no information is required."
339 (let ((gnus-command-method
340 (or gnus-command-method (inline (gnus-find-method-for-group group)))))
341 (when (stringp gnus-command-method)
342 (setq gnus-command-method
343 (inline (gnus-server-to-method gnus-command-method))))
344 (funcall (inline (gnus-get-function gnus-command-method 'request-group))
345 (gnus-group-real-name group) (nth 1 gnus-command-method)
348 (defun gnus-list-active-group (group)
349 "Request active information on GROUP."
350 (let ((gnus-command-method (gnus-find-method-for-group group))
351 (func 'list-active-group))
352 (when (gnus-check-backend-function func group)
353 (funcall (gnus-get-function gnus-command-method func)
354 (gnus-group-real-name group) (nth 1 gnus-command-method)))))
356 (defun gnus-request-group-description (group)
357 "Request a description of GROUP."
358 (let ((gnus-command-method (gnus-find-method-for-group group))
359 (func 'request-group-description))
360 (when (gnus-check-backend-function func group)
361 (funcall (gnus-get-function gnus-command-method func)
362 (gnus-group-real-name group) (nth 1 gnus-command-method)))))
364 (defun gnus-request-group-articles (group)
365 "Request a list of existing articles in GROUP."
366 (let ((gnus-command-method (gnus-find-method-for-group group))
367 (func 'request-group-articles))
368 (when (gnus-check-backend-function func group)
369 (funcall (gnus-get-function gnus-command-method func)
370 (gnus-group-real-name group) (nth 1 gnus-command-method)))))
372 (defun gnus-close-group (group)
373 "Request the GROUP be closed."
374 (let ((gnus-command-method (inline (gnus-find-method-for-group group))))
375 (funcall (gnus-get-function gnus-command-method 'close-group)
376 (gnus-group-real-name group) (nth 1 gnus-command-method))))
378 (defun gnus-retrieve-headers (articles group &optional fetch-old)
379 "Request headers for ARTICLES in GROUP.
380 If FETCH-OLD, retrieve all headers (or some subset thereof) in the group."
381 (let ((gnus-command-method (gnus-find-method-for-group group)))
383 ((and gnus-use-cache (numberp (car articles)))
384 (gnus-cache-retrieve-headers articles group fetch-old))
385 ((and gnus-agent (gnus-online gnus-command-method)
386 (gnus-agent-method-p gnus-command-method))
387 (gnus-agent-retrieve-headers articles group fetch-old))
389 (funcall (gnus-get-function gnus-command-method 'retrieve-headers)
390 articles (gnus-group-real-name group)
391 (nth 1 gnus-command-method) fetch-old)))))
393 (defun gnus-retrieve-articles (articles group)
394 "Request ARTICLES in GROUP."
395 (let ((gnus-command-method (gnus-find-method-for-group group)))
396 (funcall (gnus-get-function gnus-command-method 'retrieve-articles)
397 articles (gnus-group-real-name group)
398 (nth 1 gnus-command-method))))
400 (defun gnus-retrieve-groups (groups gnus-command-method)
401 "Request active information on GROUPS from GNUS-COMMAND-METHOD."
402 (when (stringp gnus-command-method)
403 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
404 (funcall (gnus-get-function gnus-command-method 'retrieve-groups)
405 groups (nth 1 gnus-command-method)))
407 (defun gnus-request-type (group &optional article)
408 "Return the type (`post' or `mail') of GROUP (and ARTICLE)."
409 (let ((gnus-command-method (gnus-find-method-for-group group)))
410 (if (not (gnus-check-backend-function
411 'request-type (car gnus-command-method)))
413 (funcall (gnus-get-function gnus-command-method 'request-type)
414 (gnus-group-real-name group) article))))
416 (defun gnus-request-set-mark (group action)
417 "Set marks on articles in the back end."
418 (let ((gnus-command-method (gnus-find-method-for-group group)))
419 (if (not (gnus-check-backend-function
420 'request-set-mark (car gnus-command-method)))
422 (funcall (gnus-get-function gnus-command-method 'request-set-mark)
423 (gnus-group-real-name group) action
424 (nth 1 gnus-command-method)))))
426 (defun gnus-request-update-mark (group article mark)
427 "Allow the back end to change the mark the user tries to put on an article."
428 (let ((gnus-command-method (gnus-find-method-for-group group)))
429 (if (not (gnus-check-backend-function
430 'request-update-mark (car gnus-command-method)))
432 (funcall (gnus-get-function gnus-command-method 'request-update-mark)
433 (gnus-group-real-name group) article mark))))
435 (defun gnus-request-article (article group &optional buffer)
436 "Request the ARTICLE in GROUP.
437 ARTICLE can either be an article number or an article Message-ID.
438 If BUFFER, insert the article in that group."
439 (let ((gnus-command-method (gnus-find-method-for-group group)))
440 (funcall (gnus-get-function gnus-command-method 'request-article)
441 article (gnus-group-real-name group)
442 (nth 1 gnus-command-method) buffer)))
444 (defun gnus-request-head (article group)
445 "Request the head of ARTICLE in GROUP."
446 (let* ((gnus-command-method (gnus-find-method-for-group group))
447 (head (gnus-get-function gnus-command-method 'request-head t))
453 (gnus-cache-request-article article group))
454 (setq res (cons group article)
456 ;; Check the agent cache.
457 ((gnus-agent-request-article article group)
458 (setq res (cons group article)
460 ;; Use `head' function.
462 (setq res (funcall head article (gnus-group-real-name group)
463 (nth 1 gnus-command-method))))
464 ;; Use `article' function.
466 (setq res (gnus-request-article article group)
470 (set-buffer nntp-server-buffer)
471 (goto-char (point-min))
472 (when (search-forward "\n\n" nil t)
473 (delete-region (1- (point)) (point-max)))
474 (nnheader-fold-continuation-lines)))
477 (defun gnus-request-body (article group)
478 "Request the body of ARTICLE in GROUP."
479 (let* ((gnus-command-method (gnus-find-method-for-group group))
480 (head (gnus-get-function gnus-command-method 'request-body t))
486 (gnus-cache-request-article article group))
487 (setq res (cons group article)
489 ;; Check the agent cache.
490 ((gnus-agent-request-article article group)
491 (setq res (cons group article)
493 ;; Use `head' function.
495 (setq res (funcall head article (gnus-group-real-name group)
496 (nth 1 gnus-command-method))))
497 ;; Use `article' function.
499 (setq res (gnus-request-article article group)
503 (set-buffer nntp-server-buffer)
504 (goto-char (point-min))
505 (when (search-forward "\n\n" nil t)
506 (delete-region (point-min) (1- (point))))))
509 (defun gnus-request-post (gnus-command-method)
510 "Post the current buffer using GNUS-COMMAND-METHOD."
511 (when (stringp gnus-command-method)
512 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
513 (funcall (gnus-get-function gnus-command-method 'request-post)
514 (nth 1 gnus-command-method)))
516 (defun gnus-request-scan (group gnus-command-method)
517 "Request a SCAN being performed in GROUP from GNUS-COMMAND-METHOD.
518 If GROUP is nil, all groups on GNUS-COMMAND-METHOD are scanned."
519 (let ((gnus-command-method
520 (if group (gnus-find-method-for-group group) gnus-command-method))
521 (gnus-inhibit-demon t)
522 (mail-source-plugged gnus-plugged))
523 (when (or gnus-plugged (not (gnus-agent-method-p gnus-command-method)))
524 (setq gnus-internal-registry-spool-current-method gnus-command-method)
525 (funcall (gnus-get-function gnus-command-method 'request-scan)
526 (and group (gnus-group-real-name group))
527 (nth 1 gnus-command-method)))))
529 (defsubst gnus-request-update-info (info gnus-command-method)
530 "Request that GNUS-COMMAND-METHOD update INFO."
531 (when (stringp gnus-command-method)
532 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
533 (when (gnus-check-backend-function
534 'request-update-info (car gnus-command-method))
535 (let ((group (gnus-info-group info)))
536 (and (funcall (gnus-get-function gnus-command-method
537 'request-update-info)
538 (gnus-group-real-name group)
539 info (nth 1 gnus-command-method))
540 ;; If the minimum article number is greater than 1, then all
541 ;; smaller article numbers are known not to exist; we'll
542 ;; artificially add those to the 'read range.
543 (let* ((active (gnus-active group))
546 (let* ((range (if (= min 2) 1 (cons 1 (1- min))))
547 (read (gnus-info-read info))
548 (new-read (gnus-range-add read (list range))))
549 (gnus-info-set-read info new-read)))
552 (defun gnus-request-expire-articles (articles group &optional force)
553 (let* ((gnus-command-method (gnus-find-method-for-group group))
556 (gnus-get-function gnus-command-method 'request-expire-articles)
557 articles (gnus-group-real-name group) (nth 1 gnus-command-method)
559 (when (and gnus-agent
560 (gnus-agent-method-p gnus-command-method))
561 (let ((expired-articles (gnus-sorted-difference articles not-deleted)))
562 (when expired-articles
563 (gnus-agent-expire expired-articles group 'force))))
566 (defun gnus-request-move-article (article group server accept-function
567 &optional last move-is-internal)
568 (let* ((gnus-command-method (gnus-find-method-for-group group))
569 (result (funcall (gnus-get-function gnus-command-method
570 'request-move-article)
571 article (gnus-group-real-name group)
572 (nth 1 gnus-command-method) accept-function last move-is-internal)))
573 (when (and result gnus-agent
574 (gnus-agent-method-p gnus-command-method))
575 (gnus-agent-unfetch-articles group (list article)))
578 (defun gnus-request-accept-article (group &optional gnus-command-method last
580 ;; Make sure there's a newline at the end of the article.
581 (when (stringp gnus-command-method)
582 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
583 (when (and (not gnus-command-method)
585 (setq gnus-command-method (or (gnus-find-method-for-group group)
586 (gnus-group-name-to-method group))))
587 (goto-char (point-max))
590 (let ((gnus-command-method (or gnus-command-method
591 (gnus-find-method-for-group group)))
594 (gnus-get-function gnus-command-method 'request-accept-article)
595 (if (stringp group) (gnus-group-real-name group) group)
596 (cadr gnus-command-method)
598 (when (and gnus-agent (gnus-agent-method-p gnus-command-method))
599 (gnus-agent-regenerate-group group (list (cdr result))))
602 (defun gnus-request-replace-article (article group buffer &optional no-encode)
603 (let* ((func (car (gnus-group-name-to-method group)))
604 (result (funcall (intern (format "%s-request-replace-article" func))
605 article (gnus-group-real-name group) buffer)))
606 (when (and gnus-agent (gnus-agent-method-p gnus-command-method))
607 (gnus-agent-regenerate-group group (list article)))
610 (defun gnus-request-associate-buffer (group)
611 (let ((gnus-command-method (gnus-find-method-for-group group)))
612 (funcall (gnus-get-function gnus-command-method 'request-associate-buffer)
613 (gnus-group-real-name group))))
615 (defun gnus-request-restore-buffer (article group)
616 "Request a new buffer restored to the state of ARTICLE."
617 (let ((gnus-command-method (gnus-find-method-for-group group)))
618 (funcall (gnus-get-function gnus-command-method 'request-restore-buffer)
619 article (gnus-group-real-name group)
620 (nth 1 gnus-command-method))))
622 (defun gnus-request-create-group (group &optional gnus-command-method args)
623 (when (stringp gnus-command-method)
624 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
625 (let ((gnus-command-method
626 (or gnus-command-method (gnus-find-method-for-group group))))
627 (funcall (gnus-get-function gnus-command-method 'request-create-group)
628 (gnus-group-real-name group) (nth 1 gnus-command-method) args)))
630 (defun gnus-request-delete-group (group &optional force)
631 (let* ((gnus-command-method (gnus-find-method-for-group group))
633 (funcall (gnus-get-function gnus-command-method 'request-delete-group)
634 (gnus-group-real-name group) force (nth 1 gnus-command-method))))
636 (gnus-cache-delete-group group)
637 (gnus-agent-delete-group group))
640 (defun gnus-request-rename-group (group new-name)
641 (let* ((gnus-command-method (gnus-find-method-for-group group))
643 (funcall (gnus-get-function gnus-command-method 'request-rename-group)
644 (gnus-group-real-name group)
645 (gnus-group-real-name new-name) (nth 1 gnus-command-method))))
647 (gnus-cache-rename-group group new-name)
648 (gnus-agent-rename-group group new-name))
651 (defun gnus-close-backends ()
652 ;; Send a close request to all backends that support such a request.
653 (let ((methods gnus-valid-select-methods)
654 (gnus-inhibit-demon t)
655 func gnus-command-method)
656 (while (setq gnus-command-method (pop methods))
657 (when (fboundp (setq func (intern
658 (concat (car gnus-command-method)
662 (defun gnus-asynchronous-p (gnus-command-method)
663 (let ((func (gnus-get-function gnus-command-method 'asynchronous-p t)))
667 (defun gnus-remove-denial (gnus-command-method)
668 (when (stringp gnus-command-method)
669 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
670 (let* ((elem (assoc gnus-command-method gnus-opened-servers))
671 (status (cadr elem)))
672 ;; If this hasn't been opened before, we add it to the list.
673 (when (eq status 'denied)
674 ;; Set the status of this server.
675 (setcar (cdr elem) 'closed))))
679 ;;; gnus-int.el ends here