Skip to content

Commit 113d3f7

Browse files
committed
♻️ Simplify UIDPLUS resp code parsing
1 parent e9f4a33 commit 113d3f7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/net/imap/response_parser.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,8 +1505,8 @@ def resp_text_code
15051505
when "UIDNEXT" then SP!; nz_number
15061506
when "UIDVALIDITY" then SP!; nz_number
15071507
when "UNSEEN" then SP!; nz_number # rev1 only
1508-
when "APPENDUID" then resp_code_apnd__data
1509-
when "COPYUID" then resp_code_copy__data
1508+
when "APPENDUID" then SP!; resp_code_apnd__data # rev2, UIDPLUS
1509+
when "COPYUID" then SP!; resp_code_copy__data # rev2, UIDPLUS
15101510
when "BADCHARSET" then charset_list
15111511
when "ALERT", "PARSE", "READ-ONLY", "READ-WRITE", "TRYCREATE"
15121512
when "NOMODSEQ" # CONDSTORE
@@ -1549,18 +1549,18 @@ def charset_list
15491549
# match uid_set even if that returns a single-member array.
15501550
#
15511551
def resp_code_apnd__data
1552-
match(T_SPACE); validity = number
1553-
match(T_SPACE); dst_uids = uid_set # uniqueid ⊂ uid-set
1552+
validity = number; SP!
1553+
dst_uids = uid_set # uniqueid ⊂ uid-set
15541554
UIDPlusData.new(validity, nil, dst_uids)
15551555
end
15561556

15571557
# already matched: "COPYUID"
15581558
#
15591559
# resp-code-copy = "COPYUID" SP nz-number SP uid-set SP uid-set
15601560
def resp_code_copy__data
1561-
match(T_SPACE); validity = number
1562-
match(T_SPACE); src_uids = uid_set
1563-
match(T_SPACE); dst_uids = uid_set
1561+
validity = number; SP!
1562+
src_uids = uid_set; SP!
1563+
dst_uids = uid_set
15641564
UIDPlusData.new(validity, src_uids, dst_uids)
15651565
end
15661566

0 commit comments

Comments
 (0)