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;

View file

@ -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}}
<!-- <div class="btn-group" role="group">
<button type="button" class="btn btn-sm button-announces{{if $item.responses.announce.self}} active" aria-pressed="true{{/if}}" id="announce-{{$item.id}}" title="{{$item.vote.announce.0}}" onclick="doLikeAction({{$item.id}}, 'announce'{{if $item.responses.announce.self}}, true{{/if}});" data-toggle="button"><i class="fa fa-retweet-up" aria-hidden="true"></i></button>
<div class="btn-group" role="group">
<button type="button" class="btn btn-sm button-votes{{if $item.responses.announce.self}} active" aria-pressed="true{{/if}}" id="announce-{{$item.id}}" title="{{$item.vote.announce.0}}" onclick="doLikeAction({{$item.id}}, 'announce'{{if $item.responses.announce.self}}, true{{/if}});" data-toggle="button"><i class="fa fa-retweet" aria-hidden="true"></i></button>
</div>
-->
{{/if}}
{{* Button for sharing the item *}}