From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.58.247.3 with SMTP id ya3csp567125vec; Tue, 21 Aug 2012 12:25:56 -0700 (PDT) Received: by 10.50.160.195 with SMTP id xm3mr14503496igb.12.1345577156321; Tue, 21 Aug 2012 12:25:56 -0700 (PDT) Return-Path: Received: from rubyforge.org (50-56-192-79.static.cloud-ips.com. [50.56.192.79]) by mx.google.com with ESMTP id xk1si4119836igb.12.2012.08.21.12.25.56; Tue, 21 Aug 2012 12:25:56 -0700 (PDT) Received-SPF: pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 50.56.192.79 as permitted sender) client-ip=50.56.192.79; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 50.56.192.79 as permitted sender) smtp.mail=sup-devel-bounces@rubyforge.org Received: from localhost.localdomain (localhost [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id C05942E07A; Tue, 21 Aug 2012 19:25:55 +0000 (UTC) Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU [18.9.25.13]) by rubyforge.org (Postfix) with ESMTP id 3A5942E060 for ; Tue, 21 Aug 2012 19:25:43 +0000 (UTC) X-AuditID: 1209190d-b7fd56d000000933-10-5033e0b7f265 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP id 80.A6.02355.7B0E3305; Tue, 21 Aug 2012 15:25:43 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q7LJPh0k019164; Tue, 21 Aug 2012 15:25:43 -0400 Received: from localhost ([64.119.153.34]) (authenticated bits=0) (User authenticated as ezyang@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q7LJPfQt005599; Tue, 21 Aug 2012 15:25:42 -0400 (EDT) To: "damien.leone" , sup-devel References: <1345576796-31445-1-git-send-email-ezyang@mit.edu> From: "Edward Z. Yang" In-reply-to: <1345576796-31445-1-git-send-email-ezyang@mit.edu> Date: Tue, 21 Aug 2012 15:25:41 -0400 Message-Id: <1345577064-sup-4877@javelin> User-Agent: Sup/git X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrEIsWRmVeSWpSXmKPExsUixCmqrbv9gXGAwc9WaYtX5/uYLB5P38Pu wOQx7ddKJo99+yYyBzBFcdmkpOZklqUW6dslcGXsOM5X0C1R8ejgfuYGxnVCXYycHBICJhJX X7WzQthiEhfurWfrYuTiEBLYxyix+OUKJghnA6PE1D29jBDOM0aJb88vArVwcDALqEusnwc2 SUQgWuLHrvnMILYwkD3hzUR2EFtIwE7ixZH5TCA2G1D5o2NPwbZxCthLTPzQzQJiswioSsxY 3QsW5xXQlHj35yZYvaiAsMSTI81gM5kF5CWat85mnsDIPwth8ywkmQWMTKsYZVNyq3RzEzNz ilOTdYuTE/PyUot0jfRyM0v0UlNKNzGCg06Sdwfju4NKhxgFOBiVeHhfTjEKEGJNLCuuzD3E KMnBpCTKm3PbOECILyk/pTIjsTgjvqg0J7X4EKMEB7OSCG/RZKAcb0piZVVqUT5MSpqDRUmc 90rKTX8hgfTEktTs1NSC1CKYrAwHh5IE77d7QI2CRanpqRVpmTklCGkmDk6Q4TxAw/nvgwwv LkjMLc5Mh8ifYlSUEud9CNIsAJLIKM2D64UlhVeM4kCvCPPeAqniASYUuO5XQIOZgAarXQUb XJKIkJJqYGxceDvEJSmfY9Ov+P/iRkGC8xnl3FuuVi2zMi1lDE7wfTN558qeasc1m+pLdrBZ RIqufam9KeBQXD9ztfKFHRK1Jb2XxY8v/XbwGFdbRM7k1YcqX/2O+MJ9l2vaxGubG5bo7vyh 66yrcOTW4vnRVZHvxXcwS0SVRMjfc70n6rRzU8aMvoaXn5VYijMSDbWYi4oTASZEPPnlAgAA Subject: Re: [sup-devel] [PATCH] Sync and update other threads when Maildir sync-back changes location. X-BeenThere: sup-devel@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Sup developer discussion List-Id: Sup developer discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-devel-bounces@rubyforge.org Errors-To: sup-devel-bounces@rubyforge.org This fixes the "I changed a message from unread to read in one list (e.g. 'U') and now when I open the message from inbox it can't find it" bug. Here is a version that is theoretically more efficient, though God help you if you have more than one location per message. commit ca5b02b8ff88412f92984d6b9176ff1876886cc6 Author: Edward Z. Yang Date: Tue Aug 21 15:19:11 2012 -0400 Sync and update other threads when Maildir sync-back changes location. Signed-off-by: Edward Z. Yang diff --git a/lib/sup/maildir.rb b/lib/sup/maildir.rb index 0c8c563..050cfaf 100644 --- 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 index 0616f75..9af847d 100644 --- a/lib/sup/message.rb +++ b/lib/sup/message.rb @@ -286,11 +286,16 @@ EOS end def sync_back + r = nil @locations.each do |l| if l.valid? - l.sync_back @labels if $config[:sync_back_to_maildir] and l.source.is_a? Maildir + r ||= l.sync_back @labels if $config[:sync_back_to_maildir] and l.source.is_a? Maildir end end + if r + Index.sync_message self, true + UpdateManager.relay self, :updated, self + end end def merge_labels_from_locations merge_labels Excerpts from Edward Z. Yang's message of Tue Aug 21 15:19:56 -0400 2012: > From: "Edward Z. Yang" > > Signed-off-by: Edward Z. Yang > --- > lib/sup/maildir.rb | 2 +- > lib/sup/message.rb | 6 +++++- > 2 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/lib/sup/maildir.rb b/lib/sup/maildir.rb > index 0c8c563..050cfaf 100644 > --- 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 > index 0616f75..cd9226e 100644 > --- a/lib/sup/message.rb > +++ b/lib/sup/message.rb > @@ -288,7 +288,11 @@ EOS > 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 > + r = l.sync_back @labels if $config[:sync_back_to_maildir] and l.source.is_a? Maildir > + if r > + Index.sync_message self, true > + UpdateManager.relay self, :updated, self > + end > end > end > end _______________________________________________ Sup-devel mailing list Sup-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-devel