]> source.dussan.org Git - nextcloud-server.git/commitdiff
Throw if trying to save reaction without support
authorJoas Schilling <coding@schilljs.com>
Mon, 17 Jan 2022 11:03:44 +0000 (12:03 +0100)
committerVitor Mattos <vitor@php.rio>
Fri, 21 Jan 2022 11:39:40 +0000 (08:39 -0300)
Signed-off-by: Joas Schilling <coding@schilljs.com>
lib/private/Comments/Manager.php

index 84e1a6a3cb49574d9c9b6a9e39b5f9124ce3fabf..eae84c14335dd9f83280937d34b998e90daf26d8 100644 (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 {