Gnus development mailing list
 help / color / mirror / Atom feed
From: roth@klondike.cse.ucsc.edu (Carl D. Roth)
Subject: Re: BUG: NoCeM and foreign groups: does it work?
Date: 25 Jul 1997 12:33:22 -0700	[thread overview]
Message-ID: <m3n2nbrkot.fsf@klondike.cse.ucsc.edu> (raw)
In-Reply-To: <m2pvs7ynj7.fsf@proletcult.slip.ifi.uio.no>

[-- Attachment #1: Type: text/plain, Size: 648 bytes --]

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> roth@cse.ucsc.edu (Carl D. Roth) writes:

> > The way I've worked around points 1. and 3. above is to slightly
> > modify gnus-nocem-enter-article to match groups out of a *different*
> > hashtb than gnus-newsrc-hashtb.  This new hash table consists of the
> > gnus-group-real-name mappings of all of the groups in the newsrc.

> Yes, that sounds like the right way to do it.  Could you mail me
> patches? 

I hope posting is OK...

The patch itself also adds a debugging statement to
nocem-check-article.  I run nocem in batch mode, and I want to know
about all of the `invalid' nocem issuers.


[-- Attachment #2: .signature --]
[-- Type: text/plain, Size: 65 bytes --]

Carl Roth  mailto:roth@cse.ucsc.edu  (finger for PGP public key)

[-- Attachment #3: gnus-nocem.diff --]
[-- Type: application/octet-stream, Size: 1784 bytes --]

--- gnus-nocem.el.orig	Fri Jul 25 12:25:51 1997
+++ gnus-nocem.el	Fri Jul 25 12:29:06 1997
@@ -96,6 +96,24 @@
 (defun gnus-nocem-cache-file ()
   (concat (file-name-as-directory gnus-nocem-directory) "cache"))
 
+;;
+;; faster lookups for group names:
+;;
+
+(defvar gnus-real-group-hashtb nil
+  "Real-name mappings of subscribed groups.")
+
+(defun gnus-fill-real-hashtb ()
+  "Fill up a hash table with the real-name mappings from the user's
+active file."
+  (setq gnus-real-group-hashtb (gnus-make-hashtable 123))
+  (mapcar '(lambda (group)
+	     (setq group (gnus-group-real-name (car group)))
+	     (gnus-sethash group
+			   t
+			   gnus-real-group-hashtb))
+	  gnus-newsrc-alist))
+
 (defun gnus-nocem-scan-groups ()
   "Scan all NoCeM groups for new NoCeM messages."
   (interactive)
@@ -105,6 +123,8 @@
     (gnus-make-directory gnus-nocem-directory)
     ;; Load any previous NoCeM headers.
     (gnus-nocem-load-cache)
+    ;; Get the group name mappings:
+    (gnus-fill-real-hashtb)
     ;; Read the active file if it hasn't been read yet.
     (and (file-exists-p (gnus-nocem-active-file))
 	 (not gnus-nocem-active)
@@ -185,6 +205,8 @@
 	(narrow-to-region b e)
 	(setq issuer (mail-fetch-field "issuer"))
 	(widen)
+	(or (member issuer gnus-nocem-issuers)
+	    (message "invalid NoCeM issuer: %s" issuer))
 	(and (member issuer gnus-nocem-issuers) ; We like her....
 	     (gnus-nocem-verify-issuer issuer) ; She is who she says she is...
 	     (gnus-nocem-enter-article)	; We gobble the message..
@@ -223,7 +245,7 @@
 	  (set group nil))
 	 (t
 	  (when (gnus-gethash (gnus-group-real-name (symbol-name group))
-			      gnus-newsrc-hashtb)
+			      gnus-real-group-hashtb)
 	    ;; Valid group.
 	    (beginning-of-line)
 	    (while (= (following-char) ?\t)

      reply	other threads:[~1997-07-25 19:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-07-24  0:03 Carl D. Roth
1997-07-24  0:30 ` Raja R Harinath
1997-07-24 19:08 ` David Moore
1997-07-25  0:27   ` Carl D. Roth
1997-07-25 18:50 ` Lars Magne Ingebrigtsen
1997-07-25 19:33   ` Carl D. Roth [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3n2nbrkot.fsf@klondike.cse.ucsc.edu \
    --to=roth@klondike.cse.ucsc.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).