imap-backup 13.2.0 → 13.3.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52be0d33c65e865c04931e81821a563e8203a001a951b8ec6624f0fded2180aa
|
4
|
+
data.tar.gz: 2fece56b157329aa6e8cd0bc73d66d5ec3c3923f126822977910dc904d955a1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26c0c0434bf7743a3ce9b8b6c0f24b05b14682f4e52fcacf4813cec7a913df720f6413a066b25db810e04d4e18411cfbd79119430f37785186b3013757a2e76d
|
7
|
+
data.tar.gz: 3f250c3272221488bb8b9c08b1f68198a1a6b3f45bd75c31ccc6b2284c0e2130d65bcd91783c6c85b65b4e1bbdbe09378a1ff15e595f8ab3ae016d2faeb53aee
|
@@ -52,10 +52,7 @@ module Imap::Backup
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def clean_up
|
55
|
-
if account.mirror_mode
|
56
|
-
Logger.logger.info "Mirror mode - Deleting messages only present locally"
|
57
|
-
LocalOnlyMessageDeleter.new(folder, serializer).run
|
58
|
-
end
|
55
|
+
LocalOnlyMessageDeleter.new(folder, serializer).run if account.mirror_mode
|
59
56
|
FlagRefresher.new(folder, serializer).run if account.mirror_mode || refresh
|
60
57
|
end
|
61
58
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require "imap/backup/logger"
|
2
|
+
|
1
3
|
module Imap; end
|
2
4
|
|
3
5
|
module Imap::Backup
|
@@ -15,7 +17,13 @@ module Imap::Backup
|
|
15
17
|
# but that would require a garbage collection later.
|
16
18
|
def run
|
17
19
|
local_only_uids = serializer.uids - folder.uids
|
18
|
-
|
20
|
+
if local_only_uids.empty?
|
21
|
+
Logger.logger.debug "There are no 'local-only' messages to delete"
|
22
|
+
return
|
23
|
+
end
|
24
|
+
|
25
|
+
Logger.logger.info "Deleting messages only present locally"
|
26
|
+
Logger.logger.debug "Messages to be deleted: #{local_only_uids.inspect}"
|
19
27
|
|
20
28
|
serializer.filter do |message|
|
21
29
|
!local_only_uids.include?(message.uid)
|
@@ -62,9 +62,8 @@ module Imap::Backup
|
|
62
62
|
|
63
63
|
def delete
|
64
64
|
imap.delete
|
65
|
-
@imap = nil
|
66
65
|
mbox.delete
|
67
|
-
|
66
|
+
reload
|
68
67
|
end
|
69
68
|
|
70
69
|
def apply_uid_validity(value)
|
@@ -130,8 +129,7 @@ module Imap::Backup
|
|
130
129
|
new_imap.rename imap.folder_path
|
131
130
|
mbox.delete
|
132
131
|
new_mbox.rename mbox.folder_path
|
133
|
-
|
134
|
-
@mbox = nil
|
132
|
+
reload
|
135
133
|
end
|
136
134
|
|
137
135
|
def folder_path
|
@@ -142,6 +140,11 @@ module Imap::Backup
|
|
142
140
|
@sanitized ||= Naming.to_local_path(folder)
|
143
141
|
end
|
144
142
|
|
143
|
+
def reload
|
144
|
+
@imap = nil
|
145
|
+
@mbox = nil
|
146
|
+
end
|
147
|
+
|
145
148
|
private
|
146
149
|
|
147
150
|
def rename(new_name)
|
data/lib/imap/backup/version.rb
CHANGED