Don't change resharer when resharing

This commit is contained in:
Michael 2020-10-11 17:37:04 +00:00
parent 7c5aa0bbf1
commit f3fd99da60
2 changed files with 8 additions and 4 deletions

View file

@ -2028,7 +2028,7 @@ class Item
*/
private static function setOwnerforResharedItem(array $item)
{
$parent = self::selectFirst(['id', 'owner-id', 'author-id', 'author-link', 'origin', 'post-type'],
$parent = self::selectFirst(['id', 'causer-id', 'owner-id', 'author-id', 'author-link', 'origin', 'post-type'],
['uri-id' => $item['thr-parent-id'], 'uid' => $item['uid']]);
if (!DBA::isResult($parent)) {
Logger::error('Parent not found', ['uri-id' => $item['thr-parent-id'], 'uid' => $item['uid']]);
@ -2048,6 +2048,11 @@ class Item
}
if ($author['contact-type'] != Contact::TYPE_COMMUNITY) {
if ($parent['post-type'] == self::PT_ANNOUNCEMENT) {
Logger::info('The parent is already marked as announced: quit', ['causer' => $parent['causer-id'], 'owner' => $parent['owner-id'], 'author' => $parent['author-id'], 'uid' => $item['uid']]);
return;
}
if (Contact::isSharing($parent['owner-id'], $item['uid'])) {
Logger::info('The resharer is no forum: quit', ['resharer' => $item['author-id'], 'owner' => $parent['owner-id'], 'author' => $parent['author-id'], 'uid' => $item['uid']]);
return;