Throw if trying to save reaction without support

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2022-01-17 12:03:44 +01:00 committed by Vitor Mattos
parent e0b89cd576
commit ecb98f772e
No known key found for this signature in database
GPG key ID: B7AB4B76A7CA7318

View file

@ -1099,6 +1099,10 @@ class Manager implements ICommentsManager {
* @since 9.0.0
*/
public function save(IComment $comment) {
if ($comment->getVerb() === 'reaction') {
$this->throwIfNotSupportReactions();
}
if ($this->prepareCommentForDatabaseWrite($comment)->getId() === '') {
$result = $this->insert($comment);
} else {