Added emoji reaction retraction persistence

This commit is contained in:
Samuel Hawksby-Robinson 2020-07-22 01:43:06 +01:00 committed by Andrea Maria Piana
parent 106ccfcf0f
commit 0a26d5a37d
No known key found for this signature in database
GPG Key ID: AA6CCA6DE0E06424
2 changed files with 10 additions and 1 deletions

View File

@ -804,3 +804,8 @@ func (db sqlitePersistence) EmojiReactionByID(id string) (*EmojiReaction, error)
return nil, err
}
}
func (db sqlitePersistence) RetractEmojiReaction(id string) error {
_, err := db.db.Exec(`UPDATE emoji_reactions SET retracted = 1 WHERE id = ?`, id)
return err
}

View File

@ -3331,8 +3331,12 @@ func (m *Messenger) SendEmojiReactionRetraction(ctx context.Context, emojiReacti
response := MessengerResponse{}
emojiReaction.Retracted = true
response.EmojiReactions = []*EmojiReaction{emojiReaction}
response.Chats = []*Chat{chat}
// TODO update the retraction in the db
err = m.persistence.RetractEmojiReaction(emojiReactionID)
if err != nil {
return nil, err
}
return &response, nil
}