]> git.cworth.org Git - sup/commitdiff
handle message ids with spaces in them
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Fri, 5 Oct 2007 21:45:00 +0000 (21:45 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Fri, 5 Oct 2007 21:45:00 +0000 (21:45 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@604 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/index.rb
lib/sup/message.rb

index 46e6d6e97853b5a1105f12fda1f19af345bcccf1..6ff7e5a936822ecbcccf72c95c8bec881ef1fd1e 100644 (file)
@@ -154,11 +154,10 @@ EOS
     docid, entry = load_entry_for_id m.id unless docid && entry
 
     raise "no source info for message #{m.id}" unless m.source && m.source_info
-    raise "trying deleting non-corresponding entry #{docid}" if docid && @index[docid][:message_id] != m.id
+    raise "trying to delete non-corresponding entry #{docid}" if docid && @index[docid][:message_id] != m.id
 
     source_id = 
       if m.source.is_a? Integer
-        raise "Debugging: integer source set"
         m.source
       else
         m.source.id or raise "unregistered source #{m.source} (id #{m.source.id.inspect})"
@@ -184,7 +183,7 @@ EOS
     
     docid, entry = load_entry_for_id m.id
     ## this hasn't been triggered in a long time. TODO: decide whether it's still a problem.
-    raise "just added message #{m.id} but couldn't find it in a search" unless docid
+    raise "just added message #{m.id.inspect} but couldn't find it in a search" unless docid
     true
   end
 
index 9c6f50b1feb783480f7178d4723ec48046180f82..b916b3d56ef4179804a4f433d11198a008ed8412 100644 (file)
@@ -58,7 +58,7 @@ class Message
 
     @from = PersonManager.person_for header["from"]
 
-    @id = header["message-id"]
+    @id = header["message-id"].gsub(/^\s+|\s+$/, "")
     unless @id
       @id = "sup-faked-" + Digest::MD5.hexdigest(raw_header)
       Redwood::log "faking message-id for message from #@from: #@id"