Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add fetch support for EMAILID and THREADID #206

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lib/net/imap/response_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,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
when "X-GM-MSGID" then x_gm_id # GMail
when "X-GM-THRID" then x_gm_id # GMail
when "X-GM-LABELS" then x_gm_labels # GMail
Expand Down Expand Up @@ -1976,6 +1978,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