From f3fd99da6028fbc9fd657802fbf3f7db290476e7 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 11 Oct 2020 17:37:04 +0000 Subject: [PATCH] Don't change resharer when resharing --- src/Model/Item.php | 7 ++++++- view/theme/frio/templates/wall_thread.tpl | 5 ++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index 330ac43c89..6c3fa58eb3 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -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; diff --git a/view/theme/frio/templates/wall_thread.tpl b/view/theme/frio/templates/wall_thread.tpl index 2e7a1fb27d..8bd5faa300 100644 --- a/view/theme/frio/templates/wall_thread.tpl +++ b/view/theme/frio/templates/wall_thread.tpl @@ -442,10 +442,9 @@ as the value of $top_child_total (this is done at the end of this file) {{* Button for announcing the item *}} {{if $item.vote.announce}} - {{/if}} {{* Button for sharing the item *}}