]> git.mxchange.org Git - friendica.git/commitdiff
Fix the event feature disabling logic in Object\Post
authorHypolite Petovan <hypolite@mrpetovan.com>
Wed, 27 May 2020 12:32:09 +0000 (08:32 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Wed, 27 May 2020 12:41:12 +0000 (08:41 -0400)
- Conditions on item network and dislike feature presence were mixed which could have led to unexpected behaviors

src/Object/Post.php

index 8488df000f5aa3d65d6ed72a498417c934f1e7c6..8c899683d24a710c23364c1597c1183fdfed640a 100644 (file)
@@ -380,8 +380,11 @@ class Post
                }
 
                // Disable features that aren't available in several networks
-               if ($buttons["dislike"] && !in_array($item["network"], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA])) {
-                       $buttons["dislike"] = false;
+               if (!in_array($item["network"], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA])) {
+                       if ($buttons["dislike"]) {
+                               $buttons["dislike"] = false;
+                       }
+
                        $isevent = false;
                        $tagger = '';
                }