GODT-2170: Improving test server behaviour.

This commit is contained in:
Jakub
2022-12-01 15:52:42 +01:00
committed by James Houlahan
parent 828fe0e86e
commit 8408a5fdc0
9 changed files with 36 additions and 16 deletions

View File

@ -487,10 +487,6 @@ func (user *User) handleUpdateDraftEvent(ctx context.Context, event proton.Messa
"subject": logging.Sensitive(event.Message.Subject),
}).Info("Handling draft updated event")
for _, updateCh := range user.updateCh {
updateCh.Enqueue(imap.NewMessagesDeleted(imap.MessageID(event.ID)))
}
full, err := user.client.GetFullMessage(ctx, event.Message.ID)
if err != nil {
return fmt.Errorf("failed to get full draft: %w", err)
@ -502,7 +498,12 @@ func (user *User) handleUpdateDraftEvent(ctx context.Context, event proton.Messa
return fmt.Errorf("failed to build RFC822 draft: %w", err)
}
user.updateCh[full.AddressID].Enqueue(imap.NewMessagesCreated(buildRes.update))
user.updateCh[full.AddressID].Enqueue(imap.NewMessageUpdated(
buildRes.update.Message,
buildRes.update.Literal,
buildRes.update.MailboxIDs,
buildRes.update.ParsedMessage,
))
return nil
})