vmail 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -158,7 +158,7 @@ spam, or archive. Use `v` to start marking a range of lines (the vertical
158
158
  position of the cursor doesn't matter). Then type any of the above commands to
159
159
  perform an action on all the messages you selected.
160
160
 
161
- To save you keystorkes, vmail provides alternative key mappings for
161
+ To save you keystrokes, vmail provides alternative key mappings for
162
162
  `,*`, `,#`, and `,!`:
163
163
 
164
164
  * star: `,*` → `,8`
@@ -66,6 +66,12 @@ module Vmail
66
66
  select_mailbox(@mailbox, true)
67
67
  end
68
68
 
69
+ def clear_cached_message
70
+ @current_mail = nil
71
+ @current_message_index = nil
72
+ @current_message = nil
73
+ end
74
+
69
75
  def get_highest_message_id
70
76
  # get highest message ID
71
77
  res = @imap.fetch([1,"*"], ["ENVELOPE"])
@@ -276,9 +282,7 @@ module Vmail
276
282
  end
277
283
  log "search query got #{@ids.size} results"
278
284
  @message_list = [] # this will hold all the data extracted from these message envelopes
279
- @current_mail = nil
280
- @current_message_index = nil
281
- @current_message = nil
285
+ clear_cached_message
282
286
  res = fetch_envelopes(fetch_ids)
283
287
  add_more_message_line(res, fetch_ids[0])
284
288
  end
@@ -405,8 +409,8 @@ EOF
405
409
  log @imap.uid_store(uid_set, action, [flg.to_sym])
406
410
  remove_uid_set_from_cached_lists(uid_set)
407
411
  reload_mailbox
412
+ clear_cached_message
408
413
  end
409
-
410
414
  elsif flg == '[Gmail]/Spam'
411
415
  log "Marking as spam index_range: #{index_range.inspect}; uid_set: #{uid_set.inspect}"
412
416
  Thread.new do
@@ -416,6 +420,7 @@ EOF
416
420
  log @imap.uid_store(uid_set, action, [:Deleted])
417
421
  remove_uid_set_from_cached_lists(uid_set)
418
422
  reload_mailbox
423
+ clear_cached_message
419
424
  end
420
425
  "#{id} deleted"
421
426
  else
@@ -487,6 +492,7 @@ EOF
487
492
  log @imap.uid_store(uid_set, '+FLAGS', [:Deleted])
488
493
  remove_uid_set_from_cached_lists(uid_set)
489
494
  reload_mailbox
495
+ clear_cached_message
490
496
  log "moved uid_set #{uid_set.inspect} to #{mailbox}"
491
497
  end
492
498
  end
@@ -1,3 +1,3 @@
1
1
  module Vmail
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 0
9
- version: 0.7.0
8
+ - 1
9
+ version: 0.7.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Daniel Choi