1 ;;; gnus-int.el --- backend interface functions for Gnus
2 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
3 ;; Free Software Foundation, Inc.
5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
6 ;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
9 ;; This file is part of GNU Emacs.
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
30 (eval-when-compile (require 'cl))
36 (autoload 'gnus-agent-expire "gnus-agent")
37 (autoload 'gnus-agent-regenerate-group "gnus-agent")
38 (autoload 'gnus-agent-read-servers-validate-native "gnus-agent")
40 (defcustom gnus-open-server-hook nil
41 "Hook called just before opening connection to the news server."
45 (defcustom gnus-server-unopen-status nil
46 "The default status if the server is not able to open.
47 If the server is covered by Gnus agent, the possible values are
48 `denied', set the server denied; `offline', set the server offline;
49 nil, ask user. If the server is not covered by Gnus agent, set the
53 :type '(choice (const :tag "Ask" nil)
54 (const :tag "Deny server" denied)
55 (const :tag "Unplug Agent" offline)))
57 (defvar gnus-internal-registry-spool-current-method nil
58 "The current method, for the registry.")
61 ;;; Server Communication
64 (defun gnus-start-news-server (&optional confirm)
65 "Open a method for getting news.
66 If CONFIRM is non-nil, the user will be asked for an NNTP server."
68 (if gnus-current-select-method
69 ;; Stream is already opened.
72 (unless gnus-nntp-service
73 (setq gnus-nntp-server nil))
75 ;; Read server name with completion.
76 (setq gnus-nntp-server
77 (completing-read "NNTP server: "
79 (cons (list gnus-nntp-server)
80 gnus-secondary-servers))
81 nil nil gnus-nntp-server)))
83 (when (and gnus-nntp-server
84 (stringp gnus-nntp-server)
85 (not (string= gnus-nntp-server "")))
86 (setq gnus-select-method
87 (cond ((or (string= gnus-nntp-server "")
88 (string= gnus-nntp-server "::"))
89 (list 'nnspool (system-name)))
90 ((string-match "^:" gnus-nntp-server)
91 (list 'nnmh gnus-nntp-server
93 (file-name-as-directory
95 (substring gnus-nntp-server 1) "~/")))
96 (list 'nnmh-get-new-mail nil)))
98 (list 'nntp gnus-nntp-server)))))
100 (setq how (car gnus-select-method))
104 (gnus-message 5 "Looking up local news spool..."))
107 (gnus-message 5 "Looking up mh spool..."))
110 (setq gnus-current-select-method gnus-select-method)
111 (gnus-run-hooks 'gnus-open-server-hook)
113 ;; Partially validate agent covered methods now that the
114 ;; gnus-select-method is known.
117 ;; NOTE: This is here for one purpose only. By validating
118 ;; the current select method, it converts the old 5.10.3,
119 ;; and earlier, format to the current format. That enables
120 ;; the agent code within gnus-open-server to function
122 (gnus-agent-read-servers-validate-native gnus-select-method))
125 ;; gnus-open-server-hook might have opened it
126 (gnus-server-opened gnus-select-method)
127 (gnus-open-server gnus-select-method)
131 "%s (%s) open error: '%s'. Continue? "
132 (car gnus-select-method) (cadr gnus-select-method)
133 (gnus-status-message gnus-select-method)))
134 (gnus-error 1 "Couldn't open server on %s"
135 (nth 1 gnus-select-method))))))
137 (defun gnus-check-group (group)
138 "Try to make sure that the server where GROUP exists is alive."
139 (let ((method (gnus-find-method-for-group group)))
140 (or (gnus-server-opened method)
141 (gnus-open-server method))))
143 (defun gnus-check-server (&optional method silent)
144 "Check whether the connection to METHOD is down.
145 If METHOD is nil, use `gnus-select-method'.
146 If it is down, start it up (again)."
147 (let ((method (or method gnus-select-method))
149 ;; Transform virtual server names into select methods.
150 (when (stringp method)
151 (setq method (gnus-server-to-method method)))
152 (if (gnus-server-opened method)
153 ;; The stream is already opened.
157 (gnus-message 5 "Opening %s server%s..." (car method)
158 (if (equal (nth 1 method) "") ""
159 (format " on %s" (nth 1 method)))))
160 (gnus-run-hooks 'gnus-open-server-hook)
163 (setq result (gnus-open-server method))
164 (quit (message "Quit gnus-check-server")
167 (gnus-message 5 "Opening %s server%s...%s" (car method)
168 (if (equal (nth 1 method) "") ""
169 (format " on %s" (nth 1 method)))
170 (if result "done" "failed")))))))
172 (defun gnus-get-function (method function &optional noerror)
173 "Return a function symbol based on METHOD and FUNCTION."
174 ;; Translate server names into methods.
176 (error "Attempted use of a nil select method"))
177 (when (stringp method)
178 (setq method (gnus-server-to-method method)))
179 ;; Check cache of constructed names.
180 (let* ((method-sym (if gnus-agent
181 (inline (gnus-agent-get-function method))
183 (method-fns (get method-sym 'gnus-method-functions))
184 (func (let ((method-fnlist-elt (assq function method-fns)))
185 (unless method-fnlist-elt
186 (setq method-fnlist-elt
188 (intern (format "%s-%s" method-sym function))))
189 (put method-sym 'gnus-method-functions
190 (cons method-fnlist-elt method-fns)))
191 (cdr method-fnlist-elt))))
192 ;; Maybe complain if there is no function.
193 (unless (fboundp func)
195 (error "Trying to require a method that doesn't exist"))
196 (require (car method))
197 (when (not (fboundp func))
200 (error "No such function: %s" func))))
205 ;;; Interface functions to the backends.
208 (defun gnus-open-server (gnus-command-method)
209 "Open a connection to GNUS-COMMAND-METHOD."
210 (when (stringp gnus-command-method)
211 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
212 (let ((elem (assoc gnus-command-method gnus-opened-servers)))
213 ;; If this method was previously denied, we just return nil.
214 (if (eq (nth 1 elem) 'denied)
216 (gnus-message 1 "Denied server")
219 (let* ((open-server-function (gnus-get-function gnus-command-method 'open-server))
222 (funcall open-server-function
223 (nth 1 gnus-command-method)
224 (nthcdr 2 gnus-command-method))
226 (gnus-message 1 (format
227 "Unable to open server due to: %s"
228 (error-message-string err)))
231 (gnus-message 1 "Quit trying to open server")
234 ;; If this hasn't been opened before, we add it to the list.
236 (setq elem (list gnus-command-method nil)
237 gnus-opened-servers (cons elem gnus-opened-servers)))
238 ;; Set the status of this server.
241 (if (eq open-server-function #'nnagent-open-server)
242 ;; The agent's backend has a "special" status
246 (gnus-agent-method-p gnus-command-method))
247 (cond (gnus-server-unopen-status
248 ;; Set the server's status to the unopen
249 ;; status. If that status is offline,
250 ;; recurse to open the agent's backend.
251 (setq open-offline (eq gnus-server-unopen-status 'offline))
252 gnus-server-unopen-status)
254 (format "Unable to open %s:%s, go offline? "
255 (car gnus-command-method)
256 (cadr gnus-command-method)))
257 (setq open-offline t)
260 ;; This agentized server was still denied
263 ;; This unagentized server must be denied
266 ;; NOTE: I MUST set the server's status to offline before this
267 ;; recursive call as this status will drive the
268 ;; gnus-get-function (called above) to return the agent's
271 ;; Recursively open this offline server to perform the
272 ;; open-server function of the agent's backend.
273 (let ((gnus-server-unopen-status 'denied))
274 ;; Bind gnus-server-unopen-status to avoid recursively
275 ;; prompting with "go offline?". This is only a concern
276 ;; when the agent's backend fails to open the server.
277 (gnus-open-server gnus-command-method))
280 (defun gnus-close-server (gnus-command-method)
281 "Close the connection to GNUS-COMMAND-METHOD."
282 (when (stringp gnus-command-method)
283 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
284 (funcall (gnus-get-function gnus-command-method 'close-server)
285 (nth 1 gnus-command-method)))
287 (defun gnus-request-list (gnus-command-method)
288 "Request the active file from GNUS-COMMAND-METHOD."
289 (when (stringp gnus-command-method)
290 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
291 (funcall (gnus-get-function gnus-command-method 'request-list)
292 (nth 1 gnus-command-method)))
294 (defun gnus-request-list-newsgroups (gnus-command-method)
295 "Request the newsgroups file from GNUS-COMMAND-METHOD."
296 (when (stringp gnus-command-method)
297 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
298 (funcall (gnus-get-function gnus-command-method 'request-list-newsgroups)
299 (nth 1 gnus-command-method)))
301 (defun gnus-request-newgroups (date gnus-command-method)
302 "Request all new groups since DATE from GNUS-COMMAND-METHOD."
303 (when (stringp gnus-command-method)
304 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
305 (let ((func (gnus-get-function gnus-command-method 'request-newgroups t)))
307 (funcall func date (nth 1 gnus-command-method)))))
309 (defun gnus-server-opened (gnus-command-method)
310 "Check whether a connection to GNUS-COMMAND-METHOD has been opened."
311 (unless (eq (gnus-server-status gnus-command-method)
313 (when (stringp gnus-command-method)
314 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
315 (funcall (inline (gnus-get-function gnus-command-method 'server-opened))
316 (nth 1 gnus-command-method))))
318 (defun gnus-status-message (gnus-command-method)
319 "Return the status message from GNUS-COMMAND-METHOD.
320 If GNUS-COMMAND-METHOD is a string, it is interpreted as a group
321 name. The method this group uses will be queried."
322 (let ((gnus-command-method
323 (if (stringp gnus-command-method)
324 (gnus-find-method-for-group gnus-command-method)
325 gnus-command-method)))
326 (funcall (gnus-get-function gnus-command-method 'status-message)
327 (nth 1 gnus-command-method))))
329 (defun gnus-request-regenerate (gnus-command-method)
330 "Request a data generation from GNUS-COMMAND-METHOD."
331 (when (stringp gnus-command-method)
332 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
333 (funcall (gnus-get-function gnus-command-method 'request-regenerate)
334 (nth 1 gnus-command-method)))
336 (defun gnus-request-group (group &optional dont-check gnus-command-method)
337 "Request GROUP. If DONT-CHECK, no information is required."
338 (let ((gnus-command-method
339 (or gnus-command-method (inline (gnus-find-method-for-group group)))))
340 (when (stringp gnus-command-method)
341 (setq gnus-command-method
342 (inline (gnus-server-to-method gnus-command-method))))
343 (funcall (inline (gnus-get-function gnus-command-method 'request-group))
344 (gnus-group-real-name group) (nth 1 gnus-command-method)
347 (defun gnus-list-active-group (group)
348 "Request active information on GROUP."
349 (let ((gnus-command-method (gnus-find-method-for-group group))
350 (func 'list-active-group))
351 (when (gnus-check-backend-function func group)
352 (funcall (gnus-get-function gnus-command-method func)
353 (gnus-group-real-name group) (nth 1 gnus-command-method)))))
355 (defun gnus-request-group-description (group)
356 "Request a description of GROUP."
357 (let ((gnus-command-method (gnus-find-method-for-group group))
358 (func 'request-group-description))
359 (when (gnus-check-backend-function func group)
360 (funcall (gnus-get-function gnus-command-method func)
361 (gnus-group-real-name group) (nth 1 gnus-command-method)))))
363 (defun gnus-request-group-articles (group)
364 "Request a list of existing articles in GROUP."
365 (let ((gnus-command-method (gnus-find-method-for-group group))
366 (func 'request-group-articles))
367 (when (gnus-check-backend-function func group)
368 (funcall (gnus-get-function gnus-command-method func)
369 (gnus-group-real-name group) (nth 1 gnus-command-method)))))
371 (defun gnus-close-group (group)
372 "Request the GROUP be closed."
373 (let ((gnus-command-method (inline (gnus-find-method-for-group group))))
374 (funcall (gnus-get-function gnus-command-method 'close-group)
375 (gnus-group-real-name group) (nth 1 gnus-command-method))))
377 (defun gnus-retrieve-headers (articles group &optional fetch-old)
378 "Request headers for ARTICLES in GROUP.
379 If FETCH-OLD, retrieve all headers (or some subset thereof) in the group."
380 (let ((gnus-command-method (gnus-find-method-for-group group)))
382 ((and gnus-use-cache (numberp (car articles)))
383 (gnus-cache-retrieve-headers articles group fetch-old))
384 ((and gnus-agent (gnus-online gnus-command-method)
385 (gnus-agent-method-p gnus-command-method))
386 (gnus-agent-retrieve-headers articles group fetch-old))
388 (funcall (gnus-get-function gnus-command-method 'retrieve-headers)
389 articles (gnus-group-real-name group)
390 (nth 1 gnus-command-method) fetch-old)))))
392 (defun gnus-retrieve-articles (articles group)
393 "Request ARTICLES in GROUP."
394 (let ((gnus-command-method (gnus-find-method-for-group group)))
395 (funcall (gnus-get-function gnus-command-method 'retrieve-articles)
396 articles (gnus-group-real-name group)
397 (nth 1 gnus-command-method))))
399 (defun gnus-retrieve-groups (groups gnus-command-method)
400 "Request active information on GROUPS from GNUS-COMMAND-METHOD."
401 (when (stringp gnus-command-method)
402 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
403 (funcall (gnus-get-function gnus-command-method 'retrieve-groups)
404 groups (nth 1 gnus-command-method)))
406 (defun gnus-request-type (group &optional article)
407 "Return the type (`post' or `mail') of GROUP (and ARTICLE)."
408 (let ((gnus-command-method (gnus-find-method-for-group group)))
409 (if (not (gnus-check-backend-function
410 'request-type (car gnus-command-method)))
412 (funcall (gnus-get-function gnus-command-method 'request-type)
413 (gnus-group-real-name group) article))))
415 (defun gnus-request-set-mark (group action)
416 "Set marks on articles in the back end."
417 (let ((gnus-command-method (gnus-find-method-for-group group)))
418 (if (not (gnus-check-backend-function
419 'request-set-mark (car gnus-command-method)))
421 (funcall (gnus-get-function gnus-command-method 'request-set-mark)
422 (gnus-group-real-name group) action
423 (nth 1 gnus-command-method)))))
425 (defun gnus-request-update-mark (group article mark)
426 "Allow the back end to change the mark the user tries to put on an article."
427 (let ((gnus-command-method (gnus-find-method-for-group group)))
428 (if (not (gnus-check-backend-function
429 'request-update-mark (car gnus-command-method)))
431 (funcall (gnus-get-function gnus-command-method 'request-update-mark)
432 (gnus-group-real-name group) article mark))))
434 (defun gnus-request-article (article group &optional buffer)
435 "Request the ARTICLE in GROUP.
436 ARTICLE can either be an article number or an article Message-ID.
437 If BUFFER, insert the article in that group."
438 (let ((gnus-command-method (gnus-find-method-for-group group)))
439 (funcall (gnus-get-function gnus-command-method 'request-article)
440 article (gnus-group-real-name group)
441 (nth 1 gnus-command-method) buffer)))
443 (defun gnus-request-head (article group)
444 "Request the head of ARTICLE in GROUP."
445 (let* ((gnus-command-method (gnus-find-method-for-group group))
446 (head (gnus-get-function gnus-command-method 'request-head t))
452 (gnus-cache-request-article article group))
453 (setq res (cons group article)
455 ;; Check the agent cache.
456 ((gnus-agent-request-article article group)
457 (setq res (cons group article)
459 ;; Use `head' function.
461 (setq res (funcall head article (gnus-group-real-name group)
462 (nth 1 gnus-command-method))))
463 ;; Use `article' function.
465 (setq res (gnus-request-article article group)
469 (set-buffer nntp-server-buffer)
470 (goto-char (point-min))
471 (when (search-forward "\n\n" nil t)
472 (delete-region (1- (point)) (point-max)))
473 (nnheader-fold-continuation-lines)))
476 (defun gnus-request-body (article group)
477 "Request the body of ARTICLE in GROUP."
478 (let* ((gnus-command-method (gnus-find-method-for-group group))
479 (head (gnus-get-function gnus-command-method 'request-body t))
485 (gnus-cache-request-article article group))
486 (setq res (cons group article)
488 ;; Check the agent cache.
489 ((gnus-agent-request-article article group)
490 (setq res (cons group article)
492 ;; Use `head' function.
494 (setq res (funcall head article (gnus-group-real-name group)
495 (nth 1 gnus-command-method))))
496 ;; Use `article' function.
498 (setq res (gnus-request-article article group)
502 (set-buffer nntp-server-buffer)
503 (goto-char (point-min))
504 (when (search-forward "\n\n" nil t)
505 (delete-region (point-min) (1- (point))))))
508 (defun gnus-request-post (gnus-command-method)
509 "Post the current buffer using GNUS-COMMAND-METHOD."
510 (when (stringp gnus-command-method)
511 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
512 (funcall (gnus-get-function gnus-command-method 'request-post)
513 (nth 1 gnus-command-method)))
515 (defun gnus-request-scan (group gnus-command-method)
516 "Request a SCAN being performed in GROUP from GNUS-COMMAND-METHOD.
517 If GROUP is nil, all groups on GNUS-COMMAND-METHOD are scanned."
518 (let ((gnus-command-method
519 (if group (gnus-find-method-for-group group) gnus-command-method))
520 (gnus-inhibit-demon t)
521 (mail-source-plugged gnus-plugged))
522 (when (or gnus-plugged (not (gnus-agent-method-p gnus-command-method)))
523 (setq gnus-internal-registry-spool-current-method gnus-command-method)
524 (funcall (gnus-get-function gnus-command-method 'request-scan)
525 (and group (gnus-group-real-name group))
526 (nth 1 gnus-command-method)))))
528 (defsubst gnus-request-update-info (info gnus-command-method)
529 "Request that GNUS-COMMAND-METHOD update INFO."
530 (when (stringp gnus-command-method)
531 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
532 (when (gnus-check-backend-function
533 'request-update-info (car gnus-command-method))
534 (let ((group (gnus-info-group info)))
535 (and (funcall (gnus-get-function gnus-command-method
536 'request-update-info)
537 (gnus-group-real-name group)
538 info (nth 1 gnus-command-method))
539 ;; If the minimum article number is greater than 1, then all
540 ;; smaller article numbers are known not to exist; we'll
541 ;; artificially add those to the 'read range.
542 (let* ((active (gnus-active group))
545 (let* ((range (if (= min 2) 1 (cons 1 (1- min))))
546 (read (gnus-info-read info))
547 (new-read (gnus-range-add read (list range))))
548 (gnus-info-set-read info new-read)))
551 (defun gnus-request-expire-articles (articles group &optional force)
552 (let* ((gnus-command-method (gnus-find-method-for-group group))
555 (gnus-get-function gnus-command-method 'request-expire-articles)
556 articles (gnus-group-real-name group) (nth 1 gnus-command-method)
558 (when (and gnus-agent
559 (gnus-agent-method-p gnus-command-method))
560 (let ((expired-articles (gnus-sorted-difference articles not-deleted)))
561 (when expired-articles
562 (gnus-agent-expire expired-articles group 'force))))
565 (defun gnus-request-move-article (article group server accept-function
567 (let* ((gnus-command-method (gnus-find-method-for-group group))
568 (result (funcall (gnus-get-function gnus-command-method
569 'request-move-article)
570 article (gnus-group-real-name group)
571 (nth 1 gnus-command-method) accept-function last)))
572 (when (and result gnus-agent
573 (gnus-agent-method-p gnus-command-method))
574 (gnus-agent-unfetch-articles group (list article)))
577 (defun gnus-request-accept-article (group &optional gnus-command-method last
579 ;; Make sure there's a newline at the end of the article.
580 (when (stringp gnus-command-method)
581 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
582 (when (and (not gnus-command-method)
584 (setq gnus-command-method (or (gnus-find-method-for-group group)
585 (gnus-group-name-to-method group))))
586 (goto-char (point-max))
589 (let ((gnus-command-method (or gnus-command-method
590 (gnus-find-method-for-group group)))
593 (gnus-get-function gnus-command-method 'request-accept-article)
594 (if (stringp group) (gnus-group-real-name group) group)
595 (cadr gnus-command-method)
597 (when (and gnus-agent (gnus-agent-method-p gnus-command-method))
598 (gnus-agent-regenerate-group group (list (cdr result))))
601 (defun gnus-request-replace-article (article group buffer &optional no-encode)
602 (let* ((func (car (gnus-group-name-to-method group)))
603 (result (funcall (intern (format "%s-request-replace-article" func))
604 article (gnus-group-real-name group) buffer)))
605 (when (and gnus-agent (gnus-agent-method-p gnus-command-method))
606 (gnus-agent-regenerate-group group (list article)))
609 (defun gnus-request-associate-buffer (group)
610 (let ((gnus-command-method (gnus-find-method-for-group group)))
611 (funcall (gnus-get-function gnus-command-method 'request-associate-buffer)
612 (gnus-group-real-name group))))
614 (defun gnus-request-restore-buffer (article group)
615 "Request a new buffer restored to the state of ARTICLE."
616 (let ((gnus-command-method (gnus-find-method-for-group group)))
617 (funcall (gnus-get-function gnus-command-method 'request-restore-buffer)
618 article (gnus-group-real-name group)
619 (nth 1 gnus-command-method))))
621 (defun gnus-request-create-group (group &optional gnus-command-method args)
622 (when (stringp gnus-command-method)
623 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
624 (let ((gnus-command-method
625 (or gnus-command-method (gnus-find-method-for-group group))))
626 (funcall (gnus-get-function gnus-command-method 'request-create-group)
627 (gnus-group-real-name group) (nth 1 gnus-command-method) args)))
629 (defun gnus-request-delete-group (group &optional force)
630 (let* ((gnus-command-method (gnus-find-method-for-group group))
632 (funcall (gnus-get-function gnus-command-method 'request-delete-group)
633 (gnus-group-real-name group) force (nth 1 gnus-command-method))))
635 (gnus-cache-delete-group group)
636 (gnus-agent-delete-group group))
639 (defun gnus-request-rename-group (group new-name)
640 (let* ((gnus-command-method (gnus-find-method-for-group group))
642 (funcall (gnus-get-function gnus-command-method 'request-rename-group)
643 (gnus-group-real-name group)
644 (gnus-group-real-name new-name) (nth 1 gnus-command-method))))
646 (gnus-cache-rename-group group new-name)
647 (gnus-agent-rename-group group new-name))
650 (defun gnus-close-backends ()
651 ;; Send a close request to all backends that support such a request.
652 (let ((methods gnus-valid-select-methods)
653 (gnus-inhibit-demon t)
654 func gnus-command-method)
655 (while (setq gnus-command-method (pop methods))
656 (when (fboundp (setq func (intern
657 (concat (car gnus-command-method)
661 (defun gnus-asynchronous-p (gnus-command-method)
662 (let ((func (gnus-get-function gnus-command-method 'asynchronous-p t)))
666 (defun gnus-remove-denial (gnus-command-method)
667 (when (stringp gnus-command-method)
668 (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
669 (let* ((elem (assoc gnus-command-method gnus-opened-servers))
670 (status (cadr elem)))
671 ;; If this hasn't been opened before, we add it to the list.
672 (when (eq status 'denied)
673 ;; Set the status of this server.
674 (setcar (cdr elem) 'closed))))
678 ;;; gnus-int.el ends here