]> git.mxchange.org Git - friendica.git/commitdiff
Don't change resharer when resharing
authorMichael <heluecht@pirati.ca>
Sun, 11 Oct 2020 17:37:04 +0000 (17:37 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 11 Oct 2020 17:37:04 +0000 (17:37 +0000)
src/Model/Item.php
view/theme/frio/templates/wall_thread.tpl

index 330ac43c8965d60da546b7051dffda2188f2d256..6c3fa58eb3b84b0bc15f3e610dfb7a1d086e7000 100644 (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;
index 2e7a1fb27d37e77c31f80bd078d51a9250b5b1b3..8bd5faa300fbcf21ab0dd8627cc9c5740a4acf55 100644 (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 *}}