commit 1b2dbdf073cc042075ffd377564a71e7089e825d
parent cfeded5bc63b0de1ad75cefc648660c8fbc7a07d
Author: Edward Z. Yang <ezyang@mit.edu>
Date: Tue, 21 Aug 2012 15:19:11 -0400
Sync and update other threads when Maildir sync-back changes location.
Signed-off-by: Edward Z. Yang
Diffstat:
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/lib/sup/maildir.rb b/lib/sup/maildir.rb
@@ -226,7 +226,7 @@ private
new_base = (flags.include?("S")) ? "cur" : "new"
md_base, md_ver, md_flags = maildir_data orig_path
- return orig_path if md_flags == flags
+ return if md_flags == flags
new_loc = File.join new_base, "#{md_base}:#{md_ver},#{flags}"
orig_path = File.join @dir, orig_path
diff --git a/lib/sup/message.rb b/lib/sup/message.rb
@@ -286,10 +286,11 @@ EOS
end
def sync_back
- @locations.each do |l|
- if l.valid?
- l.sync_back @labels if $config[:sync_back_to_maildir] and l.source.is_a? Maildir
- end
+ if @locations.map { |l|
+ l.sync_back @labels if l.valid? and $config[:sync_back_to_maildir] and l.source.is_a? Maildir
+ }.any?
+ Index.sync_message self, true
+ UpdateManager.relay self, :updated, self
end
end