2006-05-23 Michael Cadilhac <michael.cadilhac@lrde.org>
authorReiner Steib <Reiner.Steib@gmx.de>
Tue, 23 May 2006 14:45:56 +0000 (14:45 +0000)
committerReiner Steib <Reiner.Steib@gmx.de>
Tue, 23 May 2006 14:45:56 +0000 (14:45 +0000)
* nnrss.el (nnrss-check-group): Use the md5sum of the whole RSS item as
its hash index.  Store this hash in `nnrss-group-data'.
(nnrss-read-group-data): Update accordingly.

lisp/ChangeLog
lisp/nnrss.el

index b8045ff..f9bd3d0 100644 (file)
@@ -1,3 +1,9 @@
+2006-05-23  Michael Cadilhac  <michael.cadilhac@lrde.org>
+
+       * nnrss.el (nnrss-check-group): Use the md5sum of the whole RSS item as
+       its hash index.  Store this hash in `nnrss-group-data'.
+       (nnrss-read-group-data): Update accordingly.
+
 2006-05-23  Reiner Steib  <Reiner.Steib@gmx.de>
 
        * gnus-art.el (gnus-button-alist): Improve gnus-button-handle-symbol
index f405687..95b4b94 100644 (file)
@@ -576,7 +576,7 @@ which RSS 2.0 allows."
          (insert-file-contents file)
          (eval-region (point-min) (point-max))))
       (dolist (e nnrss-group-data)
-       (puthash (or (nth 2 e) (nth 6 e)) t nnrss-group-hashtb)
+       (puthash (nth 9 e) t nnrss-group-hashtb)
        (when (and (car e) (> nnrss-group-min (car e)))
          (setq nnrss-group-min (car e)))
        (when (and (car e) (< nnrss-group-max (car e)))
@@ -690,15 +690,12 @@ which RSS 2.0 allows."
     (dolist (item (nreverse (nnrss-find-el (intern (concat rss-ns "item")) xml)))
       (when (and (listp item)
                 (string= (concat rss-ns "item") (car item))
-                (if (setq url (nnrss-decode-entities-string
-                               (nnrss-node-text rss-ns 'link (cddr item))))
-                    (not (gethash url nnrss-group-hashtb))
-                  (setq extra (or (nnrss-node-text content-ns 'encoded item)
-                                  (nnrss-node-text rss-ns 'description item)))
-                  (not (gethash extra nnrss-group-hashtb))))
+                (progn (setq hash-index (md5 (gnus-prin1-to-string item)))
+                       (not (gethash hash-index nnrss-group-hashtb))))
        (setq subject (nnrss-node-text rss-ns 'title item))
-       (setq extra (or extra
-                       (nnrss-node-text content-ns 'encoded item)
+       (setq url (nnrss-decode-entities-string
+                  (nnrss-node-text rss-ns 'link (cddr item))))
+       (setq extra (or (nnrss-node-text content-ns 'encoded item)
                        (nnrss-node-text rss-ns 'description item)))
        (if (setq feed-subject (nnrss-node-text dc-ns 'subject item))
            (setq extra (concat feed-subject "<br /><br />" extra)))
@@ -740,9 +737,10 @@ which RSS 2.0 allows."
          date
          (and extra (nnrss-decode-entities-string extra))
          enclosure
-         comments)
+         comments
+         hash-index)
         nnrss-group-data)
-       (puthash (or url extra) t nnrss-group-hashtb)
+       (puthash hash-index t nnrss-group-hashtb)
        (setq changed t))
       (setq extra nil))
     (when changed