[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Proposal to change shimbun-rss-build-message-id

The function shimbun-rss-build-message-id, which should build a unique
message-id from an URL and optionally a date, fails for some of my RSS
groups. This is due to two things:

* Everything after a '?' in the URL is ignored, which is problematic
  since some CMS (e.g. Typo3) can generate RSS feeds with URLs like


* The optional date is not used at all.

I attached a patch which should fix this.

Also, I fail to understand the meaning of the doc string for the
luna-define-generic of shimbun-rss-build-message-id. As far as I see,
the current implementation can never return nil. Maybe it should just be
changed to simply say

  "Build unique message-id from URL and (optionally) DATE, and return it."

Index: sb-rss.el
RCS file: /storage/cvsroot/emacs-w3m/shimbun/sb-rss.el,v
retrieving revision 1.46
diff -u -r1.46 sb-rss.el
--- sb-rss.el	27 Mar 2009 22:52:16 -0000	1.46
+++ sb-rss.el	12 May 2009 12:22:23 -0000
@@ -152,8 +152,10 @@
 (luna-define-method shimbun-rss-build-message-id ((shimbun shimbun-rss)
 						  url &optional date)
-  (when (string-match "[?#]" url)
+  (when (string-match "#" url)
     (setq url (substring url 0 (match-beginning 0))))
+  (when (stringp date)
+    (setq url (concat url date)))
   (concat "<" (md5 url) "%" (shimbun-current-group shimbun)
 	  "@" (shimbun-server shimbun) ".shimbun.namazu.org>"))