Skip to content

Commit

Permalink
πŸš§πŸ“š UIDONLY: update command capabilities rdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
nevans committed Nov 8, 2024
1 parent 445e8ee commit 8e19417
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions lib/net/imap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2227,6 +2227,10 @@ def uid_expunge(uid_set)
# result = imap.search(["SUBJECT", "hi there", "not", "new"])
# #=> Net::IMAP::SearchResult[1, 6, 7, 8, modseq: 5594]
# result.modseq # => 5594
#
# The +SEARCH+ command is prohibited when
# UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] has been enabled.
# Use #uid_search instead.
def search(...)
search_internal("SEARCH", ...)
end
Expand All @@ -2243,6 +2247,15 @@ def search(...)
# capability has been enabled.
#
# See #search for documentation of parameters.
#
# ===== Capabilities
#
# The <tt><message set></tt> search criterion is prohibited when
# UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] has been enabled.
# Use +ALL+ or <tt>UID sequence-set</tt> instead.
#
# Otherwise, #uid_search is updated by extensions in the same way as
# #search.
def uid_search(...)
search_internal("UID SEARCH", ...)
end
Expand Down Expand Up @@ -2303,12 +2316,15 @@ def uid_search(...)
# When QRESYNC[https://tools.ietf.org/html/rfc7162] is enabled, the
# +vanished+ fetch modifier is _not_ allowed. The +vanished+ modifier can
# only be used with #uid_fetch.
#
# When UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] is enabled, the
# +FETCH+ command is prohibited. Use #uid_fetch instead.
def fetch(set, attr, mod = nil, changedsince: nil)
fetch_internal("FETCH", set, attr, mod, changedsince: changedsince)
end

# :call-seq:
# uid_fetch(set, attr, changedsince: nil) -> array of FetchData
# uid_fetch(set, attr, changedsince: nil) -> array of FetchData (or UIDFetchData)
#
# Sends a {UID FETCH command [IMAP4rev1 Β§6.4.8]}[https://www.rfc-editor.org/rfc/rfc3501#section-6.4.8]
# to retrieve data associated with a message in the mailbox.
Expand All @@ -2328,6 +2344,10 @@ def fetch(set, attr, mod = nil, changedsince: nil)
# When QRESYNC[https://tools.ietf.org/html/rfc7162] is enabled, the
# +vanished+ fetch modifier may be used. TODO: describe +vanished+.
#
# When UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] has been
# enabled, #uid_fetch must be used instead of #fetch, and UIDFetchData will
# be returned instead of FetchData.
#
# Otherwise, #uid_store is updated by extensions in the same way as #store.
def uid_fetch(set, attr, mod = nil, changedsince: nil)
fetch_internal("UID FETCH", set, attr, mod, changedsince: changedsince)
Expand Down Expand Up @@ -2376,6 +2396,10 @@ def uid_fetch(set, attr, mod = nil, changedsince: nil)
# {[RFC7162]}[https://tools.ietf.org/html/rfc7162] in order to use the
# +unchangedsince+ argument. Using +unchangedsince+ implicitly enables the
# +CONDSTORE+ extension.
#
# The +STORE+ command is prohibited when
# UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] has been enabled.
# Use #uid_store instead.
def store(set, attr, flags, unchangedsince: nil)
store_internal("STORE", set, attr, flags, unchangedsince: unchangedsince)
end
Expand All @@ -2393,7 +2417,11 @@ def store(set, attr, flags, unchangedsince: nil)
# Related: #store
#
# ===== Capabilities
# Same as #store.
#
# When UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] has been
# enabled, #uid_store must be used instead of #store.
#
# Otherwise, #uid_store is updated by extensions in the same way as #store.
def uid_store(set, attr, flags, unchangedsince: nil)
store_internal("UID STORE", set, attr, flags, unchangedsince: unchangedsince)
end
Expand Down

0 comments on commit 8e19417

Please sign in to comment.