]> git.mxchange.org Git - friendica.git/blobdiff - src/Object/Post.php
Merge pull request #8934 from annando/fix-fatal
[friendica.git] / src / Object / Post.php
index 8488df000f5aa3d65d6ed72a498417c934f1e7c6..ee886c1576a2a2342387d12dbe80642341d52959 100644 (file)
@@ -214,7 +214,7 @@ class Post
                        $pinned = DI::l10n()->t('pinned item');
                }
 
-               if ($origin && ($item['id'] != $item['parent']) && ($item['network'] == Protocol::ACTIVITYPUB)) {
+               if ($origin && ($item['gravity'] != GRAVITY_PARENT) && ($item['network'] == Protocol::ACTIVITYPUB)) {
                        // ActivityPub doesn't allow removal of remote comments
                        $delete = DI::l10n()->t('Delete locally');
                } else {
@@ -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 = '';
                }
@@ -874,7 +877,7 @@ class Post
 
                $terms = Tag::getByURIId($item['uri-id'], [Tag::MENTION, Tag::IMPLICIT_MENTION, Tag::EXCLUSIVE_MENTION]);
                foreach ($terms as $term) {
-                       $profile = Contact::getDetailsByURL($term['url']);
+                       $profile = Contact::getByURL($term['url'], false, ['addr', 'contact-type']);
                        if (!empty($profile['addr']) && ((($profile['contact-type'] ?? '') ?: Contact::TYPE_UNKNOWN) != Contact::TYPE_COMMUNITY) &&
                                ($profile['addr'] != $owner['addr']) && !strstr($text, $profile['addr'])) {
                                $text .= '@' . $profile['addr'] . ' ';