Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/gmail/mailbox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ def emails(key_or_opts = :all, opts={})
raise ArgumentError, "Couldn't make sense of arguments to #emails - should be an optional hash of options preceded by an optional read-status bit; OR simply an array of parameters to pass directly to the IMAP uid_search call."
end
if !opts.empty?

if opts[:after] === opts[:before]
opts[:on] = opts[:before]
opts[:after] = nil
opts[:before] = nil
end

# Support for several search macros
# :before => Date, :on => Date, :since => Date, :from => String, :to => String
search.concat ['SINCE', opts[:after].to_imap_date] if opts[:after]
Expand Down