X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=lib%2Fsup%2Fmodes%2Finbox-mode.rb;h=559892d5655f07b80a1186e114950156220a13c5;hb=e79b083fd8edcb88c169575ed5ff97c17f129023;hp=f156b69fa55fc774619cebcee136a5a575cb5d95;hpb=0f01f585ea215b9b7f32cba0795839a848e11c01;p=sup diff --git a/lib/sup/modes/inbox-mode.rb b/lib/sup/modes/inbox-mode.rb index f156b69..559892d 100644 --- a/lib/sup/modes/inbox-mode.rb +++ b/lib/sup/modes/inbox-mode.rb @@ -6,6 +6,7 @@ class InboxMode < ThreadIndexMode register_keymap do |k| ## overwrite toggle_archived with archive k.add :archive, "Archive thread (remove from inbox)", 'a' + k.add :read_and_archive, "Archive thread (remove from inbox) and mark read", 'A' end def initialize @@ -38,6 +39,23 @@ class InboxMode < ThreadIndexMode regen_text end + def read_and_archive + return unless cursor_thread + cursor_thread.remove_label :unread + cursor_thread.remove_label :inbox + hide_thread cursor_thread + regen_text + end + + def multi_read_and_archive threads + threads.each do |t| + t.remove_label :unread + t.remove_label :inbox + hide_thread t + end + regen_text + end + def handle_unarchived_update sender, m add_or_unhide m end