Changed template for direction

This commit is contained in:
Michael 2020-03-03 21:29:51 +00:00
parent 0e0de5fcad
commit d63e903d9f
4 changed files with 26 additions and 0 deletions

View File

@ -406,6 +406,15 @@ class Post
$remote_comment = ''; $remote_comment = '';
} }
$direction = [];
if (DI::config()->get('debug', 'show_direction')) {
$conversation = DBA::selectFirst('conversation', ['direction'], ['item-uri' => $item['uri']]);
if (!empty($conversation['direction']) && in_array($conversation['direction'], [1, 2])) {
$title = [1 => DI::l10n()->t('Pushed'), 2 => DI::l10n()->t('Pulled')];
$direction = ['direction' => $conversation['direction'], 'title' => $title[$conversation['direction']]];
}
}
$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)),
@ -482,6 +491,7 @@ class Post
'commented' => $item['commented'], 'commented' => $item['commented'],
'created_date' => $item['created'], 'created_date' => $item['created'],
'return' => (DI::args()->getCommand()) ? bin2hex(DI::args()->getCommand()) : '', 'return' => (DI::args()->getCommand()) ? bin2hex(DI::args()->getCommand()) : '',
'direction' => $direction,
'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

@ -496,6 +496,10 @@ return [
// Logs every call to /inbox as a JSON file in Friendica's temporary directory // Logs every call to /inbox as a JSON file in Friendica's temporary directory
'ap_inbox_log' => false, 'ap_inbox_log' => false,
// show_direction (Boolean)
// Display if a post had been fetched or had been pushed towards our server
'show_direction' => false,
// total_ap_delivery (Boolean) // total_ap_delivery (Boolean)
// Deliver via AP to every possible receiver and we suppress the delivery to these contacts with other protocols // Deliver via AP to every possible receiver and we suppress the delivery to these contacts with other protocols
'total_ap_delivery' => false, 'total_ap_delivery' => false,

View File

@ -155,6 +155,9 @@ as the value of $top_child_total (this is done at the end of this file)
{{if $item.owner_self}} {{if $item.owner_self}}
{{include file="sub/delivery_count.tpl" delivery=$item.delivery}} {{include file="sub/delivery_count.tpl" delivery=$item.delivery}}
{{/if}} {{/if}}
{{if $item.direction}}
{{include file="sub/direction.tpl" direction=$item.direction}}
{{/if}}
{{if $item.pinned}} {{if $item.pinned}}
&bull; <i class="fa fa-thumb-tack" aria-hidden="true" title="{{$item.pinned}}"></i> &bull; <i class="fa fa-thumb-tack" aria-hidden="true" title="{{$item.pinned}}"></i>
<span class="sr-only">{{$item.pinned}}</span> <span class="sr-only">{{$item.pinned}}</span>
@ -183,6 +186,9 @@ as the value of $top_child_total (this is done at the end of this file)
{{if $item.owner_self}} {{if $item.owner_self}}
{{include file="sub/delivery_count.tpl" delivery=$item.delivery}} {{include file="sub/delivery_count.tpl" delivery=$item.delivery}}
{{/if}} {{/if}}
{{if $item.direction}}
{{include file="sub/direction.tpl" direction=$item.direction}}
{{/if}}
</small> </small>
</p> </p>
</h5> </h5>
@ -202,6 +208,9 @@ as the value of $top_child_total (this is done at the end of this file)
{{if $item.owner_self}} {{if $item.owner_self}}
{{include file="sub/delivery_count.tpl" delivery=$item.delivery}} {{include file="sub/delivery_count.tpl" delivery=$item.delivery}}
{{/if}} {{/if}}
{{if $item.direction}}
{{include file="sub/direction.tpl" direction=$item.direction}}
{{/if}}
</small> </small>
</span> </span>
</h5> </h5>

View File

@ -60,6 +60,9 @@
{{if $item.owner_self}} {{if $item.owner_self}}
{{include file="sub/delivery_count.tpl" delivery=$item.delivery}} {{include file="sub/delivery_count.tpl" delivery=$item.delivery}}
{{/if}} {{/if}}
{{if $item.direction}}
{{include file="sub/direction.tpl" direction=$item.direction}}
{{/if}}
<span class="pinned">{{$item.pinned}}</span> <span class="pinned">{{$item.pinned}}</span>
</span> </span>
{{if $item.lock}}<span class="icon s10 lock fakelink" onclick="lockview(event,{{$item.id}});" title="{{$item.lock}}">{{$item.lock}}</span>{{/if}} {{if $item.lock}}<span class="icon s10 lock fakelink" onclick="lockview(event,{{$item.id}});" title="{{$item.lock}}">{{$item.lock}}</span>{{/if}}