Skip to content

Commit 471b817

Browse files
committed
Renamed #set to #uid_set in the response parser to match the RFC naming scheme
1 parent 24bec60 commit 471b817

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

lib/net/imap/response_parser.rb

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,9 +1135,9 @@ def resp_text_code
11351135
match(T_SPACE)
11361136
uidvalidity = number
11371137
match(T_SPACE)
1138-
from_uid = set
1138+
from_uid = uid_set
11391139
match(T_SPACE)
1140-
to_uid = set
1140+
to_uid = uid_set
11411141
result = ResponseCode.new(name, [uidvalidity, from_uid, to_uid])
11421142
else
11431143
token = lookahead
@@ -1341,7 +1341,15 @@ def number
13411341
return token.value.to_i
13421342
end
13431343

1344-
def set
1344+
# RFC-4315 (UIDPLUS) or RFC9051 (IMAP4rev2):
1345+
# uid-set = (uniqueid / uid-range) *("," uid-set)
1346+
# uid-range = (uniqueid ":" uniqueid)
1347+
# ; two uniqueid values and all values
1348+
# ; between these two regardless of order.
1349+
# ; Example: 2:4 and 4:2 are equivalent.
1350+
# uniqueid = nz-number
1351+
# ; Strictly ascending
1352+
def uid_set
13451353
case lookahead.symbol
13461354
when T_NUMBER then [match(T_NUMBER).value.to_i]
13471355
when T_ATOM

0 commit comments

Comments
 (0)