]> git.cworth.org Git - sup/blobdiff - lib/sup/sent.rb
Merge branch 'cancel-search' into next
[sup] / lib / sup / sent.rb
index 1f4392d76cd2a84b2f5057d0b68884c65ddcbdb4..9c802d9673a4247cff3f0a999b262cfc8edc495e 100644 (file)
@@ -21,10 +21,11 @@ class SentManager
       f.puts "From #{from_email} #{date}"
       yield f
     end
+
     @source.each do |offset, labels|
       m = Message.new :source => @source, :source_info => offset, :labels => @source.labels
       Index.sync_message m
-      UpdateManager.relay self, :add, m
+      UpdateManager.relay self, :added, m
     end
   end
 end
@@ -33,11 +34,13 @@ class SentLoader < MBox::Loader
   yaml_properties :cur_offset
 
   def initialize cur_offset=0
-    filename = Redwood::SENT_FN
-    File.open(filename, "w") { } unless File.exists? filename
-    super "mbox://" + filename, cur_offset, true, true
+    @filename = Redwood::SENT_FN
+    File.open(@filename, "w") { } unless File.exists? @filename
+    super "mbox://" + @filename, cur_offset, true, true
   end
 
+  def file_path; @filename end
+
   def uri; SentManager.source_name; end
   def to_s; SentManager.source_name; end
   def id; SentManager.source_id; end