mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-21 17:46:48 +00:00
GODT-1433 Message.Type is deprecated, use Flags instead.
This commit is contained in:
@ -177,10 +177,8 @@ func (ctl *Controller) SetDraftBody(username string, messageID string, body stri
|
||||
message.Body = body
|
||||
|
||||
// assuming this is draft we set following
|
||||
// - Draft type (NOTE: Type is not part of pmapi.MessageEvent, but it's there on API)
|
||||
// - It must not have FlagReceived and FlagSent
|
||||
// - Standard labelsIDs NOTE:wrong behaviour once we will have edge case tests for drafts outside draft folder
|
||||
message.Type = pmapi.MessageTypeDraft
|
||||
message.Flags = pmapi.FlagE2E | pmapi.FlagInternal
|
||||
message.LabelIDs = []string{pmapi.AllDraftsLabel, pmapi.AllMailLabel, pmapi.DraftLabel}
|
||||
|
||||
|
||||
@ -179,6 +179,7 @@ func (api *FakePMAPI) SendMessage(ctx context.Context, messageID string, sendMes
|
||||
}
|
||||
message.Time = time.Now().Unix()
|
||||
message.LabelIDs = append(message.LabelIDs, pmapi.SentLabel)
|
||||
message.Flags |= pmapi.FlagSent
|
||||
api.addEventMessage(pmapi.EventUpdate, message)
|
||||
return message, nil, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user