aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/email
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2023-04-11 16:29:17 +0200
committerAleksandr Nogikh <wp32pw@gmail.com>2023-04-12 13:55:59 +0200
commitec77d7cc1b8bc1c3058c2bfdcfcccb781f338f20 (patch)
tree7fc352238272f4ba07e40194449adbe9233b1db0 /pkg/email
parentdc4aafee511399ae7135a8f8d9e4cdcd9cca8fee (diff)
pkg/email: expose OwnEmail flag
We anyway already extract this information, there's no sense in extracting it again in other places.
Diffstat (limited to 'pkg/email')
-rw-r--r--pkg/email/parser.go2
-rw-r--r--pkg/email/parser_test.go1
2 files changed, 3 insertions, 0 deletions
diff --git a/pkg/email/parser.go b/pkg/email/parser.go
index 77b063055..5b472a57e 100644
--- a/pkg/email/parser.go
+++ b/pkg/email/parser.go
@@ -27,6 +27,7 @@ type Email struct {
Subject string
MailingList string
Author string
+ OwnEmail bool
Cc []string
Body string // text/plain part
Patch string // attached patch, if any
@@ -173,6 +174,7 @@ func Parse(r io.Reader, ownEmails, goodLists, domains []string) (*Email, error)
Date: date,
Link: link,
Author: author,
+ OwnEmail: fromMe,
MailingList: mailingList,
Subject: subject,
Cc: ccList,
diff --git a/pkg/email/parser_test.go b/pkg/email/parser_test.go
index 81a532648..33b2413ce 100644
--- a/pkg/email/parser_test.go
+++ b/pkg/email/parser_test.go
@@ -406,6 +406,7 @@ last line`,
Date: time.Date(2017, time.May, 7, 19, 54, 0, 0, parseTestZone),
Subject: "test subject",
Author: "foo@bar.com",
+ OwnEmail: true,
Cc: []string{"bob@example.com"},
Body: `text body
last line`,