Issue 9051: Only change the owner of posts reshared by forums

This commit is contained in:
Michael 2020-08-23 08:39:56 +00:00
parent fc2340d4af
commit 6f1cd718fc
1 changed files with 3 additions and 12 deletions

View File

@ -1994,16 +1994,12 @@ class Item
}
/**
* Change the owner of a parent item if it had been shared by a forum or a user contact
* Change the owner of a parent item if it had been shared by a forum
*
* (public) forum posts in the new format consist of the regular post by the author
* followed by an announce message sent from the forum account.
* Changing the owner helps in grouping forum posts.
*
* For other reshared posts this function changes the owner of that post
* if the author is not a user contact but the post had been shared by one.
* This helps in detecting why this post appeared in the timeline.
*
* @param array $item
* @return void
*/
@ -2022,13 +2018,8 @@ class Item
return;
}
if (($author['contact-type'] != Contact::TYPE_COMMUNITY) && (($parent['owner-id'] != $parent['author-id']) || ($item['uid'] == 0))) {
logger::info('The resharer is no forum and the parent is reshared or not a personal post: quit', ['resharer' => $item['author-id'], 'owner' => $parent['owner-id'], 'author' => $parent['author-id'], 'uid' => $item['uid']]);
return;
}
if (($author['contact-type'] != Contact::TYPE_COMMUNITY) && (Contact::isSharing($parent['author-link'], $item['uid']) || $item['origin'])) {
logger::info('The parent author is a following contact: quit', ['author' => $parent['author-link'], 'uid' => $item['uid']]);
if ($author['contact-type'] != Contact::TYPE_COMMUNITY) {
logger::info('The resharer is no forum: quit', ['resharer' => $item['author-id'], 'owner' => $parent['owner-id'], 'author' => $parent['author-id'], 'uid' => $item['uid']]);
return;
}