fix: better draft detection for parentID

This commit is contained in:
James Houlahan
2020-04-29 12:45:59 +02:00
parent 44233e5bd3
commit 23f492705b
3 changed files with 9 additions and 10 deletions

View File

@ -382,7 +382,7 @@ func (su *smtpUser) handleReferencesHeader(m *pmapi.Message) (draftID, parentID
}
metadata, _, _ := su.client.ListMessages(filter)
for _, m := range metadata {
if isDraft(m) {
if m.IsDraft() {
draftID = m.ID
} else {
parentID = m.ID
@ -411,15 +411,6 @@ func (su *smtpUser) handleReferencesHeader(m *pmapi.Message) (draftID, parentID
return draftID, parentID
}
func isDraft(m *pmapi.Message) bool {
for _, labelID := range m.LabelIDs {
if labelID == pmapi.DraftLabel {
return true
}
}
return false
}
func (su *smtpUser) handleSenderAndRecipients(m *pmapi.Message, addr *pmapi.Address, from string, to []string) (err error) {
from = pmapi.ConstructAddress(from, addr.Email)