]> git.cworth.org Git - sup/commitdiff
sup-sync: restore state on messages that don't already exist
authorRich Lane <rlane@club.cc.cmu.edu>
Sun, 23 Aug 2009 18:36:59 +0000 (11:36 -0700)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Thu, 3 Sep 2009 15:22:38 +0000 (11:22 -0400)
bin/sup-sync

index 2aa00c3720bcd0dbbce60499e5d14a70e01ae418..003a72d9c320e97d80687effb750654e0bc337aa 100755 (executable)
@@ -174,7 +174,12 @@ begin
       ## decide what to do based on message labels and the operation we're performing
       dothis, new_labels = case
       when (op == :restore) && restored_state[m.id] && old_m && (old_m.labels != restored_state[m.id])
+        num_restored += 1
         [:update_message_state, restored_state[m.id]]
+      when (op == :restore) && restored_state[m.id] && !old_m
+        num_restored += 1
+        m.labels = restored_state[m.id]
+        :add_message
       when op == :discard
         if old_m && (old_m.labels != m.labels)
           [:update_message_state, m.labels]