The contact-id of a wall posting is always the owner contact

This commit is contained in:
Michael 2022-08-22 07:54:48 +00:00
parent 51331ced9b
commit 2a0ca80630

View File

@ -451,6 +451,12 @@ class Item
if ($item['uid'] == 0) { if ($item['uid'] == 0) {
return $item['author-id']; 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)) { if (!empty($item['causer-id']) && Contact::isSharing($item['causer-id'], $item['uid'], true)) {
$cdata = Contact::getPublicAndUserContactID($item['causer-id'], $item['uid']); $cdata = Contact::getPublicAndUserContactID($item['causer-id'], $item['uid']);
if (!empty($cdata['user'])) { if (!empty($cdata['user'])) {
@ -930,9 +936,7 @@ class Item
Contact::checkAvatarCache($item['author-id']); Contact::checkAvatarCache($item['author-id']);
Contact::checkAvatarCache($item['owner-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]) && if (!empty($item['direction']) && in_array($item['direction'], [Conversation::PUSH, Conversation::RELAY]) &&
empty($item['origin']) && self::isTooOld($item)) { empty($item['origin']) && self::isTooOld($item)) {