lib/sup/sent.rb in sup-0.0.6 vs lib/sup/sent.rb in sup-0.0.7
- old
+ new
@@ -8,11 +8,11 @@
@fn = fn
@source = nil
self.class.i_am_the_instance self
end
- def self.source_name; "sent://"; end
+ def self.source_name; "sup://sent"; end
def self.source_id; 9998; end
def new_source; @source = SentLoader.new; end
def write_sent_message date, from_email
need_blank = File.exists?(@fn) && !File.zero?(@fn)
@@ -22,11 +22,11 @@
yield f
end
@source.each do |offset, labels|
m = Message.new :source => @source, :source_info => offset, :labels => labels
Index.add_message m
- UpdateManager.relay :add, m
+ UpdateManager.relay self, :add, m
end
end
end
class SentLoader < MBox::Loader
@@ -34,9 +34,10 @@
filename = Redwood::SENT_FN
File.open(filename, "w") { } unless File.exists? filename
super "mbox://" + filename, cur_offset, true, true
end
+ def uri; SentManager.source_name; end
def to_s; SentManager.source_name; end
def id; SentManager.source_id; end
def labels; [:sent, :inbox]; end
end