]> git.mxchange.org Git - friendica.git/commitdiff
Reshared data now is a link
authorMichael <heluecht@pirati.ca>
Wed, 9 Sep 2020 04:49:42 +0000 (04:49 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 9 Sep 2020 04:49:42 +0000 (04:49 +0000)
include/conversation.php
src/Object/Post.php
view/templates/wall_thread.tpl
view/theme/frio/templates/wall_thread.tpl

index 93c7fb4061c8e7d1df13d204a2b746671e95476e..99f3d76b0b13e9447487390274cc14e16bae5467 100644 (file)
@@ -727,7 +727,12 @@ function conversation_fetch_comments($thread_items, $pinned) {
                        && ($row['thr-parent'] == $row['parent-uri']) && ($row['received'] > $received)
                        && Contact::isSharing($row['author-id'], $row['uid'])) {
                        $direction = ['direction' => 3, 'title' => DI::l10n()->t('%s reshared this.', $row['author-name'])];
-                       $actor = ['link' => $row['author-link'], 'avatar' => $row['author-avatar'], 'name' => $row['author-name']];
+
+                       $author = ['uid' => 0, 'id' => $row['author-id'],
+                               'network' => $row['author-network'], 'url' => $row['author-link']];
+                       $url = '<a href="'. Contact::magicLinkByContact($author) .'">' . htmlentities($row['author-name']) . '</a>';
+
+                       $actor = ['url' => $url, 'link' => $row['author-link'], 'avatar' => $row['author-avatar'], 'name' => $row['author-name']];
                        $received = $row['received'];
                }
 
@@ -758,11 +763,13 @@ function conversation_fetch_comments($thread_items, $pinned) {
        if (!empty($direction)) {
                foreach ($parentlines as $line) {
                        $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')  ) {
-                               $comments[$line]['owner-link'] = $actor['link'];
-                               $comments[$line]['owner-avatar'] = $actor['avatar'];
-                               $comments[$line]['owner-name'] = $actor['name'];
+                       if (!empty($actor)) {
+                               $comments[$line]['reshared'] = DI::l10n()->t('%s reshared this.', $actor['url']);
+                               if (DI::pConfig()->get(local_user(), 'system', 'display_resharer')  ) {
+                                       $comments[$line]['owner-link'] = $actor['link'];
+                                       $comments[$line]['owner-avatar'] = $actor['avatar'];
+                                       $comments[$line]['owner-name'] = $actor['name'];
+                               }
                        }
                }
        }
index 788fdedde689216de8f8545befd5c04ddcfbe46c..071652b5e4ec5f496bd5167d0bf636f25b026af5 100644 (file)
@@ -419,12 +419,6 @@ class Post
                        }
                }
 
-               if (!empty($item['reshared'])) {
-                       $reshared = $item['reshared'];
-               } else {
-                       $reshared = '';
-               }
-
                $tmp_item = [
                        'template'        => $this->getTemplate(),
                        'type'            => implode("", array_slice(explode("/", $item['verb']), -1)),
@@ -503,7 +497,7 @@ class Post
                        'uriid'           => $item['uri-id'],
                        'return'          => (DI::args()->getCommand()) ? bin2hex(DI::args()->getCommand()) : '',
                        'direction'       => $direction,
-                       'reshared'        => $reshared,
+                       'reshared'        => $item['reshared'] ?? '',
                        '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 c2b43695935e427e09b60b5c69b7a76e66d3300f..202eb2b619b775d72e22215d528f0a804021b801 100644 (file)
@@ -20,6 +20,9 @@
 <a name="{{$item.id}}" ></a>
 <div class="wall-item-outside-wrapper {{$item.indent}}{{$item.previewing}}{{if $item.owner_url}} wallwall{{/if}}" id="wall-item-outside-wrapper-{{$item.id}}" >
        <div class="wall-item-content-wrapper {{$item.indent}} {{$item.shiny}}" id="wall-item-content-wrapper-{{$item.id}}" >
+               {{if $item.reshared}}
+                       <div class="wall-item-ammounce wall-item-responses" id="wall-item-ammounce-{{$item.id}}">{{$item.reshared nofilter}}</div>
+               {{/if}}
                <div class="wall-item-info{{if $item.owner_url}} wallwall{{/if}}" id="wall-item-info-{{$item.id}}">
                        {{if $item.owner_url}}
                        <div class="wall-item-photo-wrapper wwto" id="wall-item-ownerphoto-wrapper-{{$item.id}}" >
index a4f980827a906e409df0e4dd66b82840ec2f4682..317217b47d653cb1513b6654f330058a579701d9 100644 (file)
@@ -82,7 +82,7 @@ as the value of $top_child_total (this is done at the end of this file)
 {{/if}}
        <div class="media {{$item.shiny}}">
        {{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.reshared nofilter}}</div>
        {{/if}}
                {{* The avatar picture and the photo-menu *}}
                <div class="dropdown pull-left"><!-- Dropdown -->