rgrove-larch 1.0.0.10 → 1.0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/larch/imap/mailbox.rb +2 -2
- data/lib/larch/imap.rb +3 -3
- data/lib/larch/version.rb +1 -1
- metadata +1 -1
data/lib/larch/imap/mailbox.rb
CHANGED
@@ -165,7 +165,7 @@ class Mailbox
|
|
165
165
|
# Subscribes to this mailbox.
|
166
166
|
def subscribe(force = false)
|
167
167
|
return if subscribed? && !force
|
168
|
-
@imap.safely { @imap.conn.subscribe(@name) }
|
168
|
+
@imap.safely { @imap.conn.subscribe(@name) } unless @imap.options[:dry_run]
|
169
169
|
@mutex.synchronize { @subscribed = true }
|
170
170
|
end
|
171
171
|
|
@@ -177,7 +177,7 @@ class Mailbox
|
|
177
177
|
# Unsubscribes to this mailbox.
|
178
178
|
def unsubscribe(force = false)
|
179
179
|
return unless subscribed? || force
|
180
|
-
@imap.safely { @imap.conn.unsubscribe(@name) }
|
180
|
+
@imap.safely { @imap.conn.unsubscribe(@name) } unless @imap.options[:dry_run]
|
181
181
|
@mutex.synchronize { @subscribed = false }
|
182
182
|
end
|
183
183
|
|
data/lib/larch/imap.rb
CHANGED
@@ -27,7 +27,7 @@ class IMAP
|
|
27
27
|
# [:dry_run]
|
28
28
|
# If +true+, read-only operations will be performed as usual and all change
|
29
29
|
# operations will be simulated, but no changes will actually be made. Note
|
30
|
-
# that it's not actually possible to
|
30
|
+
# that it's not actually possible to simulate mailbox creation, so
|
31
31
|
# +:dry_run+ mode always behaves as if +:create_mailbox+ is +false+.
|
32
32
|
#
|
33
33
|
# [:fast_scan]
|
@@ -312,8 +312,8 @@ class IMAP
|
|
312
312
|
end
|
313
313
|
|
314
314
|
def update_mailboxes
|
315
|
-
all = safely { @conn.list('', '*') }
|
316
|
-
subscribed = safely { @conn.lsub('', '*') }
|
315
|
+
all = safely { @conn.list('', '*') } || []
|
316
|
+
subscribed = safely { @conn.lsub('', '*') } || []
|
317
317
|
|
318
318
|
@mutex.synchronize do
|
319
319
|
# Remove cached mailboxes that no longer exist.
|
data/lib/larch/version.rb
CHANGED