feat: add --quote flag to include original message in replies#169
Open
terry-li-hm wants to merge 7 commits intosteipete:mainfrom
Open
feat: add --quote flag to include original message in replies#169terry-li-hm wants to merge 7 commits intosteipete:mainfrom
terry-li-hm wants to merge 7 commits intosteipete:mainfrom
Conversation
added 7 commits
February 3, 2026 16:16
Adds a --quote flag to gog gmail send that automatically quotes the original message when replying. Changes: - Added --quote flag to GmailSendCmd struct - Modified fetchReplyInfo to optionally fetch message body - Added formatQuotedMessage function for attribution and quoting - Updated validation to require reply target when --quote is used
Add automatic message quoting when replying to emails. The new --quote flag includes the original message body with proper attribution line and quote prefixes when using --reply-to-message-id or --thread-id. Changes: - Add Quote bool flag to GmailSendCmd struct - Validate --quote requires reply target (--reply-to-message-id or --thread-id) - Modify fetchReplyInfo to support fetching full message format for quoting - Add Date and Body fields to replyInfo struct - Add formatQuotedMessage function to format original message as quote - Append quoted message to user's body when --quote is set - Update test calls to replyInfoFromMessage with new includeBody parameter - Use gmailFormatFull/gmailFormatMetadata constants instead of string literals - Use body += for appending instead of body = body +
- Quote now works when original message has only HTML content (no plain text body) - Removed unused formatQuotedMessageHTML function Fixes edge cases where --quote would skip messages with HTML-only bodies.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
--quoteflag togog gmail sendthat automatically quotes the original message when replying, with proper Gmail rendering.Features
>prefixed lines for plain text email clients<blockquote>with blue left borderUsage
How it works
>prefix to--body<blockquote>containing original HTMLChanges
--quoteflag toGmailSendCmdstructreplyInfoto includeBodyHTMLfor preserving original formattingfetchReplyInfoto fetch full message body when quotingformatQuotedMessage()for plain text quotesformatQuotedMessageHTML()andformatQuotedMessageHTMLWithContent()for HTML quotes--quoteis used (even without--body-html)Testing
go test ./internal/cmd/... -run 'Send|Reply'- all tests pass