mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-15 14:56:42 +00:00
fix: better draft detection for parentID
This commit is contained in:
@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user