]> git.mxchange.org Git - friendica.git/commitdiff
Changed template for direction
authorMichael <heluecht@pirati.ca>
Tue, 3 Mar 2020 21:29:51 +0000 (21:29 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 3 Mar 2020 21:29:51 +0000 (21:29 +0000)
src/Object/Post.php
static/defaults.config.php
view/theme/frio/templates/wall_thread.tpl
view/theme/vier/templates/wall_thread.tpl

index 1c1f85e2a502bfa0677a31cd8686a0735992a37b..76cf6b0367f25633c6deb5a8dec41e0c4f8f537b 100644 (file)
@@ -406,6 +406,15 @@ class Post
                        $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 = [
                        'template'        => $this->getTemplate(),
                        'type'            => implode("", array_slice(explode("/", $item['verb']), -1)),
@@ -482,6 +491,7 @@ class Post
                        'commented'       => $item['commented'],
                        'created_date'    => $item['created'],
                        'return'          => (DI::args()->getCommand()) ? bin2hex(DI::args()->getCommand()) : '',
+                       'direction'       => $direction,
                        'delivery'        => [
                                'queue_count'       => $item['delivery_queue_count'],
                                'queue_done'        => $item['delivery_queue_done'] + $item['delivery_queue_failed'], /// @todo Possibly display it separately in the future
index ab47eef19ce40e0ca90f85e5c0cba30bb9892968..110c016eb0b2e1bf626879b63d17dac3dd612ed0 100644 (file)
@@ -496,6 +496,10 @@ return [
                // Logs every call to /inbox as a JSON file in Friendica's temporary directory
                '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)
                // Deliver via AP to every possible receiver and we suppress the delivery to these contacts with other protocols
                'total_ap_delivery' => false,
index 5a0cf57fada66c8a35cbd03167178e52fca61a94..a5a785af7eaf1c466664a4834cc9394dac616c94 100644 (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}}
                                                        {{include file="sub/delivery_count.tpl" delivery=$item.delivery}}
                                                {{/if}}
+                                               {{if $item.direction}}
+                                                       {{include file="sub/direction.tpl" direction=$item.direction}}
+                                               {{/if}}
                                                {{if $item.pinned}}
                                                        &bull; <i class="fa fa-thumb-tack" aria-hidden="true" title="{{$item.pinned}}"></i>
                                                        <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}}
                                                        {{include file="sub/delivery_count.tpl" delivery=$item.delivery}}
                                                {{/if}}
+                                               {{if $item.direction}}
+                                                       {{include file="sub/direction.tpl" direction=$item.direction}}
+                                               {{/if}}
                                        </small>
                                </p>
                        </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}}
                                                        {{include file="sub/delivery_count.tpl" delivery=$item.delivery}}
                                                {{/if}}
+                                               {{if $item.direction}}
+                                                       {{include file="sub/direction.tpl" direction=$item.direction}}
+                                               {{/if}}
                                        </small>
                                </span>
                        </h5>
index aef411bcaae51755d19615ea92a662947395829f..31ab92a3d7a63a847cf5bd330762d7a14a596e1f 100644 (file)
@@ -60,6 +60,9 @@
                                {{if $item.owner_self}}
                                        {{include file="sub/delivery_count.tpl" delivery=$item.delivery}}
                                {{/if}}
+                               {{if $item.direction}}
+                                       {{include file="sub/direction.tpl" direction=$item.direction}}
+                               {{/if}}
                                <span class="pinned">{{$item.pinned}}</span>
                        </span>
                        {{if $item.lock}}<span class="icon s10 lock fakelink" onclick="lockview(event,{{$item.id}});" title="{{$item.lock}}">{{$item.lock}}</span>{{/if}}