mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 12:46:46 +00:00
fix: better draft detection for parentID
This commit is contained in:
@ -219,6 +219,13 @@ func (m *Message) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// IsDraft returns whether the message should be considered to be a draft.
|
||||
// A draft is complicated. It might have pmapi.DraftLabel but it might not.
|
||||
// The real API definition of IsDraft is that it is neither sent nor received -- we should use that here.
|
||||
func (m *Message) IsDraft() bool {
|
||||
return (m.Flags & (FlagReceived | FlagSent)) == 0
|
||||
}
|
||||
|
||||
func (m *Message) IsBodyEncrypted() bool {
|
||||
trimmedBody := strings.TrimSpace(m.Body)
|
||||
return strings.HasPrefix(trimmedBody, MessageHeader) &&
|
||||
|
||||
Reference in New Issue
Block a user