Expose X-GM-THRID via Fetch::gmail_thread_id()#138
Conversation
imap-proto already parses the Gmail thread id (X-GM-THRID) into AttributeValue::GmailThrId, but Fetch had no accessor for it, unlike its siblings gmail_msg_id() and gmail_labels(). Add gmail_thread_id() mirroring gmail_msg_id(), plus a unit test in parse.rs covering both the present and absent cases. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
One thing worth flagging for the record: In practice this isn't a problem under normal dependency resolution — Cargo will happily pick 0.16.6+ within that I left the |
Summary
imap-protoalready parses the Gmail thread id (X-GM-THRID) intoAttributeValue::GmailThrId, butFetchprovided no getter for it — unlike its siblingsgmail_msg_id()(X-GM-MSGID) andgmail_labels()(X-GM-LABELS). This adds the missing accessor:It mirrors
gmail_msg_id()exactly, just matchingAttributeValue::GmailThrIdinstead ofAttributeValue::GmailMsgId.Motivation:
X-GM-THRIDlets clients group messages into Gmail conversations/threads without re-implementing Gmail's threading heuristics. Sincegmail_msg_id/gmail_labelsare already exposed, this fills the gap for the one remaining Gmail extension attributeimap-protoparses.Test plan
parse_fetches_gmail_thread_idinsrc/parse.rs, following the existingparse_fetches_testconvention: feeds a* 24 FETCH (... X-GM-THRID 1278455344230334865)response throughparse_fetchesand assertsgmail_thread_id()returns the parsed value, andNonefor a FETCH response without it.cargo fmt --checkandcargo test --features runtime-async-stdpass (70 unit tests, including the new one).🤖 Generated with Claude Code