Skip to content

Commit

Permalink
✨ Add fetch support for EMAILID and THREADID [🚧 tests]
Browse files Browse the repository at this point in the history
These are the `msg-att` added by the `OBJECTID` extension.
  • Loading branch information
nevans committed Oct 30, 2023
1 parent 7b75be9 commit 8af0ed4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/net/imap/response_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,8 @@ def msg_att(n)
when "RFC822.HEADER" then nstring # not in rev2
when "RFC822.TEXT" then nstring # not in rev2
when "MODSEQ" then parens__modseq # CONDSTORE
when "EMAILID" then parens__objectid # OBJECTID TODO:tests
when "THREADID" then nparens__objectid # OBJECTID TODO:tests
else parse_error("unknown attribute `%s' for {%d}", name, n)
end
attr[name] = val
Expand Down Expand Up @@ -1755,6 +1757,15 @@ def charset; quoted? || atom end

def parens__modseq; lpar; _ = permsg_modsequence; rpar; _ end

# RFC8474:
# objectid = 1*255(ALPHA / DIGIT / "_" / "-")
# ; characters in object identifiers are case
# ; significant
alias objectid atom

def parens__objectid; lpar; _ = objectid; rpar; _ end
def nparens__objectid; NIL? ? nil : parens__objectid end

# RFC-4315 (UIDPLUS) or RFC9051 (IMAP4rev2):
# uid-set = (uniqueid / uid-range) *("," uid-set)
# uid-range = (uniqueid ":" uniqueid)
Expand Down

0 comments on commit 8af0ed4

Please sign in to comment.