GODT-1433 Message.Type is deprecated, use Flags instead.

This commit is contained in:
Jakub
2021-11-30 17:03:50 +01:00
parent 55beb9227f
commit a0dc764bb9
9 changed files with 50 additions and 45 deletions

View File

@ -133,7 +133,7 @@ func (q *sendRecorder) isSendingOrSent(client messageGetter, hash string) (isSen
if err != nil {
return
}
if message.Type == pmapi.MessageTypeDraft {
if message.IsDraft() {
// If message is in draft for a long time, let's assume there is
// some problem and message will not be sent anymore.
if time.Since(time.Unix(message.Time, 0)).Minutes() > 10 {
@ -141,8 +141,8 @@ func (q *sendRecorder) isSendingOrSent(client messageGetter, hash string) (isSen
}
isSending = true
}
// MessageTypeInboxAndSent can be when message was sent to myself.
if message.Type == pmapi.MessageTypeSent || message.Type == pmapi.MessageTypeInboxAndSent {
// Message can be in Inbox and Sent when message was sent to myself.
if message.Has(pmapi.FlagSent) {
wasSent = true
}