Skip to content

Commit 8be322d

Browse files
committed
♻️ Simplify PERMANENTFLAGS response code parsing
1 parent e2d3adc commit 8be322d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/net/imap/response_parser.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1501,7 +1501,7 @@ def resp_text_code
15011501
data =
15021502
case name
15031503
when "CAPABILITY" then resp_code__capability
1504-
when "PERMANENTFLAGS" then SP!; flag_list
1504+
when "PERMANENTFLAGS" then SP? ? flag_perm__list : []
15051505
when "UIDVALIDITY" then SP!; number
15061506
when "UIDNEXT" then SP!; number
15071507
when "UNSEEN" then SP!; number
@@ -1638,6 +1638,8 @@ def flag_list
16381638
end
16391639
end
16401640

1641+
# TODO: not quite correct. flag-perm != flag
1642+
alias flag_perm__list flag_list
16411643

16421644
# See https://www.rfc-editor.org/errata/rfc3501
16431645
#

0 commit comments

Comments
 (0)