Sha256: 042b060cd6bf9ca6fed793bb55ced35040239b3f8b99d4e25c5d315fbe99a49a
Contents?: true
Size: 631 Bytes
Versions: 11
Compression:
Stored size: 631 Bytes
Contents
module Imap; end module Imap::Backup class LocalOnlyMessageDeleter attr_reader :folder attr_reader :serializer def initialize(folder, serializer) @folder = folder @serializer = serializer end # TODO: this method is very slow as it copies all messages. # A quicker method would only remove UIDs from the .imap file, # but that would require a garbage collection later. def run local_only_uids = serializer.uids - folder.uids return if local_only_uids.empty? serializer.filter do |message| !local_only_uids.include?(message.uid) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems