vmail 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/vmail/imap_client.rb +12 -4
- data/lib/vmail/version.rb +1 -1
- metadata +2 -2
data/lib/vmail/imap_client.rb
CHANGED
@@ -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
|
-
|
152
|
-
|
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