test: set sent label properly

This commit is contained in:
James Houlahan
2020-07-03 08:22:28 +02:00
parent 10e384f4df
commit b25baa2524
3 changed files with 17 additions and 8 deletions

View File

@ -241,6 +241,16 @@ func (m *Message) IsDraft() bool {
return (m.Flags & (FlagReceived | FlagSent)) == 0
}
// HasLabelID returns whether the message has the `labelID`.
func (m *Message) HasLabelID(labelID string) bool {
for _, l := range m.LabelIDs {
if l == labelID {
return true
}
}
return false
}
func (m *Message) IsBodyEncrypted() bool {
trimmedBody := strings.TrimSpace(m.Body)
return strings.HasPrefix(trimmedBody, MessageHeader) &&