sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 5127833d2b9511cc185227b12f27d37b31c87886
parent 8df45b735e37ee278bb0ff4f409955abfb8df0cd
Author: Whyme Lyu <callme5long@gmail.com>
Date:   Sun, 19 May 2013 16:22:18 +0800

Show processed message count and tell user to refresh

Before we have a decent MVC architecture this should be fine.

Diffstat:
M lib/sup/modes/console_mode.rb | 8 ++++++++
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/lib/sup/modes/console_mode.rb b/lib/sup/modes/console_mode.rb
@@ -12,19 +12,27 @@ class Console
   end
 
   def add_labels(query, *labels)
+    count = 0
     query(query).each do |m|
       labels.each {|l| m.add_label l }
       Index.update_message_state m
+      count += 1
     end
     Index.save_index
+    puts "Labels modified on #{count} messages."
+    puts "You might want to refresh open buffer with `@` key."
   end
 
   def remove_labels(query, *labels)
+    count = 0
     query(query).each do |m|
       labels.each {|l| m.remove_label l }
       Index.update_message_state m
+      count += 1
     end
     Index.save_index
+    puts "Labels modified on #{count} messages."
+    puts "You might want to refresh open buffer with `@` key."
   end
 
   def xapian; Index.instance.instance_variable_get :@xapian; end