commit ec08b7a8418bed5bd24c88bc14eb0591fc35a501
parent 62a2714b18617ab4bbc85a551640c05ece74c354
Author: Damien Leone <damien.leone@fensalir.fr>
Date: Fri, 9 Jul 2010 23:25:21 +0200
message: rewrite the sync_back method
I noticed that a sent message can have multiples locations and when
you change its labels only one location is updated (because of the
"location" method). It now synchronizes the message to all its
locations.
Diffstat:
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/lib/sup/message.rb b/lib/sup/message.rb
@@ -286,12 +286,10 @@ EOS
end
def sync_back
- begin
- location.sync_back @labels if $config[:sync_back_to_maildir] and source.is_a? Maildir
- true
- rescue SourceError => e
- warn "cannot sync back #{id}, locations have been removed from the disk"
- false
+ @locations.each do |l|
+ if l.valid?
+ l.sync_back @labels and $config[:sync_back_to_maildir] and l.source.is_a? Maildir
+ end
end
end