vmail 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -118,7 +118,7 @@ module Vmail
118
118
  end
119
119
 
120
120
  # id_set may be a range, array, or string
121
- def fetch_envelopes(id_set, are_uids=false)
121
+ def fetch_envelopes(id_set, are_uids=false, is_update=false)
122
122
  log "fetch_envelopes: #{id_set.inspect}"
123
123
  if id_set.is_a?(String)
124
124
  id_set = id_set.split(',')
@@ -148,8 +148,16 @@ module Vmail
148
148
  each {|old_row_data| old_row_data[:row_text] = new_row_data[:row_text]}
149
149
  }
150
150
  else
151
- # put new rows after the current ones
152
- @message_list = @message_list.concat new_message_rows
151
+
152
+ if is_update
153
+ log "adding messages from update to end of list"
154
+ @message_list = @message_list.concat new_message_rows
155
+ else
156
+ # this adds old messages to the top of the list
157
+ # put new rows before the current ones
158
+ log "adding more messages to head of list"
159
+ @message_list = new_message_rows + @message_list
160
+ end
153
161
  end
154
162
  log "returning #{new_message_rows.size} new rows"
155
163
  return new_message_rows.
@@ -293,7 +301,7 @@ module Vmail
293
301
  @ids = @ids + new_ids
294
302
  log "update: new uids: #{new_ids.inspect}"
295
303
  if !new_ids.empty?
296
- res = fetch_envelopes(new_ids)
304
+ res = fetch_envelopes(new_ids, false, true)
297
305
  res
298
306
  end
299
307
  end
data/lib/vmail/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Vmail
2
- VERSION = "0.6.2"
2
+ VERSION = "0.6.3"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 6
8
- - 2
9
- version: 0.6.2
8
+ - 3
9
+ version: 0.6.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Daniel Choi