]> git.cworth.org Git - sup/commitdiff
bugfix: :sent label not being applied to sent messages
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Sun, 6 Sep 2009 13:45:25 +0000 (09:45 -0400)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Sun, 6 Sep 2009 13:45:25 +0000 (09:45 -0400)
At least, for mbox sent sources. Modify the mbox source so that it calls
self.labels for the message labels instead of directly using @labels. This
allows the SentLoader subclass to apply the sent label by defining #labels.

lib/sup/mbox/loader.rb

index 030759483289f2ee6bd115b818e9dfecb5a986de..a11bf9541e6efed049754cf85442c6cdbd714c8b 100644 (file)
@@ -9,6 +9,8 @@ class Loader < Source
   include SerializeLabelsNicely
   yaml_properties :uri, :cur_offset, :usual, :archived, :id, :labels
 
+  attr_reader :labels
+
   ## uri_or_fp is horrific. need to refactor.
   def initialize uri_or_fp, start_offset=0, usual=true, archived=false, id=nil, labels=nil
     @mutex = Mutex.new
@@ -169,7 +171,7 @@ class Loader < Source
     end
 
     self.cur_offset = next_offset
-    [returned_offset, (@labels + [:unread])]
+    [returned_offset, (labels + [:unread])]
   end
 end