Skip to content

Commit dcbef82

Browse files
committed
📚 UIDONLY: update command capabilities rdoc
1 parent 04766f9 commit dcbef82

File tree

1 file changed

+50
-9
lines changed

1 file changed

+50
-9
lines changed

lib/net/imap.rb

Lines changed: 50 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ module Net
735735
# * {GSSAPI/Kerberos/SASL Service Names}[https://www.iana.org/assignments/gssapi-service-names/gssapi-service-names.xhtml]:
736736
# +imap+
737737
# * {Character sets}[https://www.iana.org/assignments/character-sets/character-sets.xhtml]
738-
# ===== For currently unsupported features:
738+
# ==== For currently unsupported features:
739739
# * {IMAP Quota Resource Types}[http://www.iana.org/assignments/imap4-capabilities#imap-capabilities-2]
740740
# * {LIST-EXTENDED options and responses}[https://www.iana.org/assignments/imap-list-extended/imap-list-extended.xhtml]
741741
# * {IMAP METADATA Server Entry and Mailbox Entry Registries}[https://www.iana.org/assignments/imap-metadata/imap-metadata.xhtml]
@@ -2377,6 +2377,10 @@ def uid_expunge(uid_set)
23772377
# result = imap.search(["SUBJECT", "hi there", "not", "new"])
23782378
# #=> Net::IMAP::SearchResult[1, 6, 7, 8, modseq: 5594]
23792379
# result.modseq # => 5594
2380+
#
2381+
# The +SEARCH+ command is prohibited when
2382+
# UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] has been enabled.
2383+
# Use #uid_search instead.
23802384
def search(...)
23812385
search_internal("SEARCH", ...)
23822386
end
@@ -2394,6 +2398,15 @@ def search(...)
23942398
# capability has been enabled.
23952399
#
23962400
# See #search for documentation of parameters.
2401+
#
2402+
# ==== Capabilities
2403+
#
2404+
# When UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] is enabled, the
2405+
# <tt><message set></tt> search criterion is prohibited. Use +ALL+ or
2406+
# <tt>UID sequence-set</tt> instead.
2407+
#
2408+
# Otherwise, #uid_search is updated by extensions in the same way as
2409+
# #search.
23972410
def uid_search(...)
23982411
search_internal("UID SEARCH", ...)
23992412
end
@@ -2445,12 +2458,15 @@ def uid_search(...)
24452458
# {[RFC7162]}[https://tools.ietf.org/html/rfc7162] in order to use the
24462459
# +changedsince+ argument. Using +changedsince+ implicitly enables the
24472460
# +CONDSTORE+ extension.
2461+
#
2462+
# When UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] is enabled, the
2463+
# +FETCH+ command is prohibited. Use #uid_fetch instead.
24482464
def fetch(...)
24492465
fetch_internal("FETCH", ...)
24502466
end
24512467

24522468
# :call-seq:
2453-
# uid_fetch(set, attr, changedsince: nil, partial: nil) -> array of FetchData
2469+
# uid_fetch(set, attr, changedsince: nil, partial: nil) -> array of FetchData (or UIDFetchData)
24542470
#
24552471
# Sends a {UID FETCH command [IMAP4rev1 §6.4.8]}[https://www.rfc-editor.org/rfc/rfc3501#section-6.4.8]
24562472
# to retrieve data associated with a message in the mailbox.
@@ -2502,7 +2518,11 @@ def fetch(...)
25022518
# {[RFC9394]}[https://rfc-editor.org/rfc/rfc9394] in order to use the
25032519
# +partial+ argument.
25042520
#
2505-
# Otherwise, the same as #fetch.
2521+
# When UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] has been
2522+
# enabled, #uid_fetch must be used instead of #fetch, and UIDFetchData will
2523+
# be returned instead of FetchData.
2524+
#
2525+
# Otherwise, #uid_fetch is updated by extensions in the same way as #fetch.
25062526
def uid_fetch(...)
25072527
fetch_internal("UID FETCH", ...)
25082528
end
@@ -2550,12 +2570,16 @@ def uid_fetch(...)
25502570
# {[RFC7162]}[https://tools.ietf.org/html/rfc7162] in order to use the
25512571
# +unchangedsince+ argument. Using +unchangedsince+ implicitly enables the
25522572
# +CONDSTORE+ extension.
2573+
#
2574+
# The +STORE+ command is prohibited when
2575+
# UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] has been enabled.
2576+
# Use #uid_store instead.
25532577
def store(set, attr, flags, unchangedsince: nil)
25542578
store_internal("STORE", set, attr, flags, unchangedsince: unchangedsince)
25552579
end
25562580

25572581
# :call-seq:
2558-
# uid_store(set, attr, value, unchangedsince: nil) -> array of FetchData
2582+
# uid_store(set, attr, value, unchangedsince: nil) -> array of FetchData (or UIDFetchData)
25592583
#
25602584
# Sends a {UID STORE command [IMAP4rev1 §6.4.8]}[https://www.rfc-editor.org/rfc/rfc3501#section-6.4.8]
25612585
# to alter data associated with messages in the mailbox, in particular their
@@ -2567,7 +2591,12 @@ def store(set, attr, flags, unchangedsince: nil)
25672591
# Related: #store
25682592
#
25692593
# ==== Capabilities
2570-
# Same as #store.
2594+
#
2595+
# When UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] has been
2596+
# enabled, #uid_store must be used instead of #store, and UIDFetchData will
2597+
# be returned instead of FetchData.
2598+
#
2599+
# Otherwise, #uid_store is updated by extensions in the same way as #store.
25712600
def uid_store(set, attr, flags, unchangedsince: nil)
25722601
store_internal("UID STORE", set, attr, flags, unchangedsince: unchangedsince)
25732602
end
@@ -2586,6 +2615,9 @@ def uid_store(set, attr, flags, unchangedsince: nil)
25862615
# with UIDPlusData. This will report the UIDVALIDITY of the destination
25872616
# mailbox, the UID set of the source messages, and the assigned UID set of
25882617
# the moved messages.
2618+
#
2619+
# When UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] is enabled, the
2620+
# +COPY+ command is prohibited. Use #uid_copy instead.
25892621
def copy(set, mailbox)
25902622
copy_internal("COPY", set, mailbox)
25912623
end
@@ -2598,7 +2630,10 @@ def copy(set, mailbox)
25982630
#
25992631
# ==== Capabilities
26002632
#
2601-
# +UIDPLUS+ affects #uid_copy the same way it affects #copy.
2633+
# When UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] has been
2634+
# enabled, #uid_copy must be used instead of #copy.
2635+
#
2636+
# Otherwise, #uid_copy is updated by extensions in the same way as #copy.
26022637
def uid_copy(set, mailbox)
26032638
copy_internal("UID COPY", set, mailbox)
26042639
end
@@ -2622,6 +2657,8 @@ def uid_copy(set, mailbox)
26222657
# mailbox, the UID set of the source messages, and the assigned UID set of
26232658
# the moved messages.
26242659
#
2660+
# When UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] is enabled, the
2661+
# +MOVE+ command is prohibited. Use #uid_move instead.
26252662
def move(set, mailbox)
26262663
copy_internal("MOVE", set, mailbox)
26272664
end
@@ -2637,9 +2674,13 @@ def move(set, mailbox)
26372674
#
26382675
# ==== Capabilities
26392676
#
2640-
# Same as #move: The server's capabilities must include +MOVE+
2641-
# [RFC6851[https://tools.ietf.org/html/rfc6851]]. +UIDPLUS+ also affects
2642-
# #uid_move the same way it affects #move.
2677+
# The server's capabilities must include either +IMAP4rev2+ or +MOVE+
2678+
# [RFC6851[https://tools.ietf.org/html/rfc6851]].
2679+
#
2680+
# When UIDONLY[https://www.rfc-editor.org/rfc/rfc9586.html] has been
2681+
# enabled, #uid_move must be used instead of #move.
2682+
#
2683+
# Otherwise, #uid_move is updated by extensions in the same way as #move.
26432684
def uid_move(set, mailbox)
26442685
copy_internal("UID MOVE", set, mailbox)
26452686
end

0 commit comments

Comments
 (0)