]> git.mxchange.org Git - friendica.git/blobdiff - src/Content/Conversation.php
Merge pull request #10936 from annando/speed-unused-contacts
[friendica.git] / src / Content / Conversation.php
index b5a9ab9766ef478fce7a698f50c4c2d90dc52ce6..879e47c24d3e1762a7c11fdeb8e80a7ca8fb229c 100644 (file)
@@ -25,9 +25,6 @@ use Friendica\App;
 use Friendica\App\Arguments;
 use Friendica\App\BaseURL;
 use Friendica\BaseModule;
-use Friendica\Content\ContactSelector;
-use Friendica\Content\Feature;
-use Friendica\Content\Item;
 use Friendica\Core\ACL;
 use Friendica\Core\Config\IConfig;
 use Friendica\Core\Hook;
@@ -288,15 +285,15 @@ class Conversation
                $this->profiler->startRecording('rendering');
                $o = '';
 
-               $x['allow_location']   = $x['allow_location'] ?? $user['allow_location'];
+               $x['allow_location']   = $x['allow_location']   ?? $user['allow_location'];
                $x['default_location'] = $x['default_location'] ?? $user['default-location'];
-               $x['nickname']         = $x['nickname'] ?? $user['nickname'];
-               $x['lockstate']        = $x['lockstate'] ?? ACL::getLockstateForUserId($user['uid']) ? 'lock' : 'unlock';
-               $x['acl']              = $x['acl'] ?? ACL::getFullSelectorHTML($this->page, $user['uid'], true);
-               $x['bang']             = $x['bang'] ?? '';
-               $x['visitor']          = $x['visitor'] ?? 'block';
-               $x['is_owner']         = $x['is_owner'] ?? true;
-               $x['profile_uid']      = $x['profile_uid'] ?? local_user();
+               $x['nickname']         = $x['nickname']         ?? $user['nickname'];
+               $x['lockstate']        = $x['lockstate']        ?? ACL::getLockstateForUserId($user['uid']) ? 'lock' : 'unlock';
+               $x['acl']              = $x['acl']              ?? ACL::getFullSelectorHTML($this->page, $user['uid'], true);
+               $x['bang']             = $x['bang']             ?? '';
+               $x['visitor']          = $x['visitor']          ?? 'block';
+               $x['is_owner']         = $x['is_owner']         ?? true;
+               $x['profile_uid']      = $x['profile_uid']      ?? local_user();
 
 
                $geotag = !empty($x['allow_location']) ? Renderer::replaceMacros(Renderer::getMarkupTemplate('jot_geotag.tpl'), []) : '';
@@ -443,16 +440,16 @@ class Conversation
                                        . "; var netargs = '" . substr($this->args->getCommand(), 8)
                                        . '?f='
                                        . (!empty($_GET['contactid']) ? '&contactid=' . rawurlencode($_GET['contactid']) : '')
-                                       . (!empty($_GET['search']) ? '&search=' . rawurlencode($_GET['search']) : '')
-                                       . (!empty($_GET['star']) ? '&star=' . rawurlencode($_GET['star']) : '')
-                                       . (!empty($_GET['order']) ? '&order=' . rawurlencode($_GET['order']) : '')
-                                       . (!empty($_GET['bmark']) ? '&bmark=' . rawurlencode($_GET['bmark']) : '')
-                                       . (!empty($_GET['liked']) ? '&liked=' . rawurlencode($_GET['liked']) : '')
-                                       . (!empty($_GET['conv']) ? '&conv=' . rawurlencode($_GET['conv']) : '')
-                                       . (!empty($_GET['nets']) ? '&nets=' . rawurlencode($_GET['nets']) : '')
-                                       . (!empty($_GET['cmin']) ? '&cmin=' . rawurlencode($_GET['cmin']) : '')
-                                       . (!empty($_GET['cmax']) ? '&cmax=' . rawurlencode($_GET['cmax']) : '')
-                                       . (!empty($_GET['file']) ? '&file=' . rawurlencode($_GET['file']) : '')
+                                       . (!empty($_GET['search'])    ? '&search='    . rawurlencode($_GET['search'])    : '')
+                                       . (!empty($_GET['star'])      ? '&star='      . rawurlencode($_GET['star'])      : '')
+                                       . (!empty($_GET['order'])     ? '&order='     . rawurlencode($_GET['order'])     : '')
+                                       . (!empty($_GET['bmark'])     ? '&bmark='     . rawurlencode($_GET['bmark'])     : '')
+                                       . (!empty($_GET['liked'])     ? '&liked='     . rawurlencode($_GET['liked'])     : '')
+                                       . (!empty($_GET['conv'])      ? '&conv='      . rawurlencode($_GET['conv'])      : '')
+                                       . (!empty($_GET['nets'])      ? '&nets='      . rawurlencode($_GET['nets'])      : '')
+                                       . (!empty($_GET['cmin'])      ? '&cmin='      . rawurlencode($_GET['cmin'])      : '')
+                                       . (!empty($_GET['cmax'])      ? '&cmax='      . rawurlencode($_GET['cmax'])      : '')
+                                       . (!empty($_GET['file'])      ? '&file='      . rawurlencode($_GET['file'])      : '')
 
                                        . "'; </script>\r\n";
                        }
@@ -687,7 +684,7 @@ class Conversation
                                                'like_html'            => '',
                                                'dislike_html '        => '',
                                                'comment_html'         => '',
-                                               'conv'                 => ($preview ? '' : ['href' => 'display/' . $item['guid'], 'title'=> $this->l10n->t('View in context')]),
+                                               'conv'                 => ($preview ? '' : ['href' => 'display/' . $item['guid'], 'title' => $this->l10n->t('View in context')]),
                                                'previewing'           => $previewing,
                                                'wait'                 => $this->l10n->t('Please wait'),
                                                'thread_level'         => 1,
@@ -699,7 +696,6 @@ class Conversation
                                        $threads[$threadsid]['id']      = $item['id'];
                                        $threads[$threadsid]['network'] = $item['network'];
                                        $threads[$threadsid]['items']   = [$arr['output']];
-
                                }
                        } else {
                                // Normal View
@@ -847,8 +843,8 @@ class Conversation
                                }
 
                                if (($row['gravity'] == GRAVITY_PARENT) && !empty($row['causer-id'])) {
-                                       $causer = ['uid' => 0, 'id' => $row['causer-id'],
-                                               'network' => $row['causer-network'], 'url' => $row['causer-link']];
+                                       $causer = ['uid' => 0, 'id' => $row['causer-id'], 'network' => $row['causer-network'], 'url' => $row['causer-link']];
+
                                        $row['reshared'] = $this->l10n->t('%s reshared this.', '<a href="'. htmlentities(Contact::magicLinkByContact($causer)) .'">' . htmlentities($row['causer-name']) . '</a>');
                                }
                                $row['direction'] = ['direction' => 3, 'title' => (empty($row['causer-id']) ? $this->l10n->t('Reshared') : $this->l10n->t('Reshared by %s <%s>', $row['causer-name'], $row['causer-link']))];