sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 56fac5b07c8beb0b6a4707f6a7f36c93ff307e1d
parent 6339ac927dc395142b205409b06345aeeb5060d3
Author: William Morgan <wmorgan-sup@masanjin.net>
Date:   Tue, 24 Mar 2009 20:22:11 -0700

Merge branch 'merge-labels' into next

Diffstat:
M bin/sup-sync | 2 +-
M lib/sup/poll.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/bin/sup-sync b/bin/sup-sync
@@ -158,7 +158,7 @@ begin
       ## assign message labels based on the operation we're performing
       case op
       when :asis
-        m.labels = (m.labels + index_state).uniq if index_state
+        m.labels = ((m.labels - [:unread, :inbox]) + index_state).uniq if index_state
       when :restore
         ## if the entry exists on disk
         if restored_state[m.id]
diff --git a/lib/sup/poll.rb b/lib/sup/poll.rb
@@ -97,7 +97,7 @@ EOS
         numi = 0
         add_messages_from source do |m, offset, entry|
           ## always preserve the labels on disk.
-          m.labels = (m.labels + entry[:label].split(/\s+/).map { |x| x.intern }).uniq if entry
+          m.labels = ((m.labels - [:unread, :inbox]) + entry[:label].split(/\s+/).map { |x| x.intern }).uniq if entry
           yield "Found message at #{offset} with labels {#{m.labels * ', '}}"
           unless entry
             num += 1