]> git.mxchange.org Git - friendica.git/commitdiff
The contact-id of a wall posting is always the owner contact
authorMichael <heluecht@pirati.ca>
Mon, 22 Aug 2022 07:54:48 +0000 (07:54 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 22 Aug 2022 07:54:48 +0000 (07:54 +0000)
src/Model/Item.php

index 5ab98f2069cc316c6e02acb78fe700fa24aacf7f..c00bd06de4480364a7640854e96dc4dbf177010e 100644 (file)
@@ -451,6 +451,12 @@ class Item
                if ($item['uid'] == 0) {
                        return $item['author-id'];
                }
+
+               if ($item['origin']) {
+                       $owner = User::getOwnerDataById($item['uid']);
+                       return $owner['id'];
+               }
+
                if (!empty($item['causer-id']) && Contact::isSharing($item['causer-id'], $item['uid'], true)) {
                        $cdata = Contact::getPublicAndUserContactID($item['causer-id'], $item['uid']);
                        if (!empty($cdata['user'])) {
@@ -930,9 +936,7 @@ class Item
                Contact::checkAvatarCache($item['author-id']);
                Contact::checkAvatarCache($item['owner-id']);
 
-               if (!Contact::isSharing($item['contact-id'], $item['uid'])) {
-                       $item['contact-id'] = self::contactId($item);
-               }
+               $item['contact-id'] = self::contactId($item);
 
                if (!empty($item['direction']) && in_array($item['direction'], [Conversation::PUSH, Conversation::RELAY]) &&
                        empty($item['origin']) && self::isTooOld($item)) {