]> git.cworth.org Git - sup/blobdiff - lib/sup/sent.rb
rewrite Singleton to not require i_am_the_instance
[sup] / lib / sup / sent.rb
index e6ae856dc12f654fd08a7dd7469c52532fb3ef7d..d381395104a5575e1011c88560021cc2c0820764 100644 (file)
@@ -8,7 +8,6 @@ class SentManager
   def initialize source_uri
     @source = nil
     @source_uri = source_uri
-    self.class.i_am_the_instance self
     Redwood::log "SentManager intialized with source uri: #@source_uri"
   end
 
@@ -30,9 +29,9 @@ class SentManager
   def write_sent_message date, from_email, &block
     @source.store_message date, from_email, &block
 
-    PollManager.add_messages_from(@source) do |m, o, e|
+    PollManager.each_message_from(@source) do |m|
       m.remove_label :unread
-      m
+      PollManager.add_new_message m
     end
   end
 end
@@ -52,7 +51,7 @@ class SentLoader < MBox::Loader
   def uri; 'sup://sent' end
 
   def id; 9998; end
-  def labels; [:inbox]; end
+  def labels; [:inbox, :sent]; end
 end
 
 end