@@ -1929,6 +1929,9 @@ def uid_expunge(uid_set)
1929
1929
end
1930
1930
end
1931
1931
1932
+ # :call-seq:
1933
+ # search(criteria, charset = nil) -> result
1934
+ #
1932
1935
# Sends a {SEARCH command [IMAP4rev1 §6.4.4]}[https://www.rfc-editor.org/rfc/rfc3501#section-6.4.4]
1933
1936
# to search the mailbox for messages that match the given searching
1934
1937
# criteria, and returns message sequence numbers. +keys+ can either be a
@@ -1996,10 +1999,13 @@ def uid_expunge(uid_set)
1996
1999
# result = imap.search(["SUBJECT", "hi there", "not", "new")
1997
2000
# #=> Net::IMAP::SearchResult[1, 6, 7, 8, modseq: 5594]
1998
2001
# result.modseq # => 5594
1999
- def search ( keys , charset = nil )
2000
- return search_internal ( "SEARCH" , keys , charset )
2002
+ def search ( ... )
2003
+ search_internal ( "SEARCH" , ... )
2001
2004
end
2002
2005
2006
+ # :call-seq:
2007
+ # uid_search(criteria, charset = nil) -> result
2008
+ #
2003
2009
# Sends a {UID SEARCH command [IMAP4rev1 §6.4.8]}[https://www.rfc-editor.org/rfc/rfc3501#section-6.4.8]
2004
2010
# to search the mailbox for messages that match the given searching
2005
2011
# criteria, and returns unique identifiers (<tt>UID</tt>s).
@@ -2008,7 +2014,7 @@ def search(keys, charset = nil)
2008
2014
# backward compatibility) but adds SearchResult#modseq when the +CONDSTORE+
2009
2015
# capability has been enabled.
2010
2016
#
2011
- # See #search for documentation of search criteria .
2017
+ # See #search for documentation of parameters .
2012
2018
def uid_search ( keys , charset = nil )
2013
2019
return search_internal ( "UID SEARCH" , keys , charset )
2014
2020
end
@@ -2939,7 +2945,7 @@ def enforce_logindisabled?
2939
2945
end
2940
2946
end
2941
2947
2942
- def search_internal ( cmd , keys , charset )
2948
+ def search_internal ( cmd , keys , charset = nil )
2943
2949
keys = normalize_searching_criteria ( keys )
2944
2950
args = charset ? [ "CHARSET" , charset , *keys ] : keys
2945
2951
synchronize do
0 commit comments