Issue 9135: Display only reshared posts at the top

This commit is contained in:
Michael 2020-09-08 22:06:10 +00:00
parent fb7f7435c0
commit 42dcd6646e
4 changed files with 10 additions and 3 deletions

View File

@ -758,6 +758,7 @@ function conversation_fetch_comments($thread_items, $pinned) {
if (!empty($direction)) { if (!empty($direction)) {
foreach ($parentlines as $line) { foreach ($parentlines as $line) {
$comments[$line]['direction'] = $direction; $comments[$line]['direction'] = $direction;
$comments[$line]['reshared'] = DI::l10n()->t('%s reshared this.', $actor['name']);
if (!empty($actor) && DI::pConfig()->get(local_user(), 'system', 'display_resharer') ) { if (!empty($actor) && DI::pConfig()->get(local_user(), 'system', 'display_resharer') ) {
$comments[$line]['owner-link'] = $actor['link']; $comments[$line]['owner-link'] = $actor['link'];
$comments[$line]['owner-avatar'] = $actor['avatar']; $comments[$line]['owner-avatar'] = $actor['avatar'];

View File

@ -419,6 +419,12 @@ class Post
} }
} }
if (!empty($item['reshared'])) {
$reshared = $item['reshared'];
} else {
$reshared = '';
}
$tmp_item = [ $tmp_item = [
'template' => $this->getTemplate(), 'template' => $this->getTemplate(),
'type' => implode("", array_slice(explode("/", $item['verb']), -1)), 'type' => implode("", array_slice(explode("/", $item['verb']), -1)),
@ -497,6 +503,7 @@ class Post
'uriid' => $item['uri-id'], 'uriid' => $item['uri-id'],
'return' => (DI::args()->getCommand()) ? bin2hex(DI::args()->getCommand()) : '', 'return' => (DI::args()->getCommand()) ? bin2hex(DI::args()->getCommand()) : '',
'direction' => $direction, 'direction' => $direction,
'reshared' => $reshared,
'delivery' => [ 'delivery' => [
'queue_count' => $item['delivery_queue_count'], 'queue_count' => $item['delivery_queue_count'],
'queue_done' => $item['delivery_queue_done'] + $item['delivery_queue_failed'], /// @todo Possibly display it separately in the future 'queue_done' => $item['delivery_queue_done'] + $item['delivery_queue_failed'], /// @todo Possibly display it separately in the future

View File

@ -1985,6 +1985,7 @@ ul.dropdown-menu li:hover {
} }
/* Media Classes */ /* Media Classes */
.wall-item-ammounce,
.media .time, .media .time,
.media .shared-time, .media .shared-time,
.media .delivery, .media .delivery,

View File

@ -81,7 +81,7 @@ as the value of $top_child_total (this is done at the end of this file)
<span class="uriid" style="display: none;">{{$item.uriid}}</span> <span class="uriid" style="display: none;">{{$item.uriid}}</span>
{{/if}} {{/if}}
<div class="media {{$item.shiny}}"> <div class="media {{$item.shiny}}">
{{if $item.responses.announce && $mode != 'display'}} {{if $item.reshared}}
<div class="wall-item-ammounce wall-item-responses" id="wall-item-ammounce-{{$item.id}}">{{$item.responses.announce.output nofilter}}</div> <div class="wall-item-ammounce wall-item-responses" id="wall-item-ammounce-{{$item.id}}">{{$item.responses.announce.output nofilter}}</div>
{{/if}} {{/if}}
{{* The avatar picture and the photo-menu *}} {{* The avatar picture and the photo-menu *}}
@ -530,9 +530,7 @@ as the value of $top_child_total (this is done at the end of this file)
{{if $item.responses}} {{if $item.responses}}
<div class="wall-item-responses"> <div class="wall-item-responses">
{{foreach $item.responses as $verb=>$response}} {{foreach $item.responses as $verb=>$response}}
{{if $verb != 'announce' || $mode == 'display'}}
<div class="wall-item-{{$verb}}" id="wall-item-{{$verb}}-{{$item.id}}">{{$response.output nofilter}}</div> <div class="wall-item-{{$verb}}" id="wall-item-{{$verb}}-{{$item.id}}">{{$response.output nofilter}}</div>
{{/if}}
{{/foreach}} {{/foreach}}
</div> </div>
{{/if}} {{/if}}