Handle delete events during portal create sleep

Probably fixes #7
This commit is contained in:
Tulir Asokan 2023-08-25 20:47:20 +03:00
parent 612fb2bae7
commit 5767138006

View file

@ -821,6 +821,9 @@ func (user *User) syncConversation(v *gmproto.Conversation, source string) {
if cancel := portal.cancelCreation.Load(); cancel != nil {
if updateType == gmproto.ConversationStatus_SPAM_FOLDER || updateType == gmproto.ConversationStatus_BLOCKED_FOLDER {
(*cancel)(fmt.Errorf("conversation was moved to spam"))
} else if updateType == gmproto.ConversationStatus_DELETED {
(*cancel)(fmt.Errorf("conversation was deleted"))
portal.Delete()
} else {
log.Debug().Msg("Conversation creation is still pending, ignoring new sync event")
return