X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FConversation.php;h=d9036c78399c99be8fdd77a94a2fd4ee4f4c4c70;hb=8fd0d4cdc090dfdeeaf9beda8090c030d3f853c3;hp=7773cdd508ea258dc31f7806db3adb27c8c26da7;hpb=f03c5c7f89f6f8de1bedf5908cf72fe32e369eaa;p=friendica.git diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php index 7773cdd508..d9036c7839 100644 --- a/src/Content/Conversation.php +++ b/src/Content/Conversation.php @@ -146,7 +146,7 @@ class Conversation 'url' => $activity['author-link'] ]; $url = Contact::magicLinkByContact($author); - if (strpos($url, 'redir/') === 0) { + if (strpos($url, 'contact/redir/') === 0) { $sparkle = ' class="sparkle" '; } @@ -493,7 +493,7 @@ class Conversation if (!$update) { $live_update_div = '
' . "\r\n" . "\r\n"; + . "; var netargs = '?f='; \r\n"; } } elseif ($mode === 'display') { $items = $this->addChildren($items, false, $order, $uid, $mode); @@ -520,13 +520,13 @@ class Conversation if (!$update) { $live_update_div = '
' . "\r\n" . "\r\n"; + ."?f='; \r\n"; } } elseif ($mode === 'search') { $live_update_div = '' . "\r\n"; } - $page_dropping = $this->session->getLocalUserId() && $this->session->getLocalUserId() == $uid; + $page_dropping = $this->session->getLocalUserId() && $this->session->getLocalUserId() == $uid && $mode != 'search'; if (!$update) { $_SESSION['return_path'] = $this->args->getQueryString(); @@ -612,7 +612,7 @@ class Conversation $profile_link = Contact::magicLinkByContact($author); $sparkle = ''; - if (strpos($profile_link, 'redir/') === 0) { + if (strpos($profile_link, 'contact/redir/') === 0) { $sparkle = ' sparkle'; } @@ -794,7 +794,7 @@ class Conversation return []; } - $str_blocked = str_replace(["\n", "\r"], ",", $this->pConfig->get($this->session->getLocalUserId(), 'system', 'blocked')); + $str_blocked = str_replace(["\n", "\r"], ",", $this->pConfig->get($this->session->getLocalUserId(), 'system', 'blocked') ?? ''); if (empty($str_blocked)) { return []; } @@ -970,7 +970,7 @@ class Conversation } $condition = DBA::mergeConditions($condition, - ["`uid` IN (0, ?) AND (`vid` != ? OR `vid` IS NULL)", $uid, Verb::getID(Activity::FOLLOW)]); + ["`uid` IN (0, ?) AND (NOT `vid` IN (?, ?) OR `vid` IS NULL)", $uid, Verb::getID(Activity::FOLLOW), Verb::getID(Activity::VIEW)]); $thread_parents = Post::select(['uri-id', 'causer-id'], $condition, ['order' => ['uri-id' => false, 'uid']]); @@ -985,7 +985,8 @@ class Conversation $thread_items = Post::selectForUser($uid, array_merge(ItemModel::DISPLAY_FIELDLIST, ['featured', 'contact-uid', 'gravity', 'post-type', 'post-reason']), $condition, $params); - $items = []; + $items = []; + $quote_uri_ids = []; while ($row = Post::fetch($thread_items)) { if (!empty($items[$row['uri-id']]) && ($row['uid'] == 0)) { @@ -1005,11 +1006,37 @@ class Conversation } } + if (in_array($row['gravity'], [ItemModel::GRAVITY_PARENT, ItemModel::GRAVITY_COMMENT])) { + $quote_uri_ids[$row['uri-id']] = [ + 'uri-id' => $row['uri-id'], + 'uri' => $row['uri'], + 'parent-uri-id' => $row['parent-uri-id'], + 'parent-uri' => $row['parent-uri'], + ]; + } + $items[$row['uri-id']] = $this->addRowInformation($row, $activities[$row['uri-id']] ?? [], $thr_parent[$row['thr-parent-id']] ?? []); } DBA::close($thread_items); + $quotes = Post::select(array_merge(ItemModel::DISPLAY_FIELDLIST, ['featured', 'contact-uid', 'gravity', 'post-type', 'post-reason']), ['quote-uri-id' => array_column($quote_uri_ids, 'uri-id'), 'body' => '', 'uid' => 0]); + while ($quote = Post::fetch($quotes)) { + $row = $quote; + + $row['uid'] = $uid; + $row['verb'] = $row['body'] = $row['raw-body'] = Activity::ANNOUNCE; + $row['gravity'] = ItemModel::GRAVITY_ACTIVITY; + $row['object-type'] = Activity\ObjectType::NOTE; + $row['parent-uri'] = $quote_uri_ids[$quote['quote-uri-id']]['parent-uri']; + $row['parent-uri-id'] = $quote_uri_ids[$quote['quote-uri-id']]['parent-uri-id']; + $row['thr-parent'] = $quote_uri_ids[$quote['quote-uri-id']]['uri']; + $row['thr-parent-id'] = $quote_uri_ids[$quote['quote-uri-id']]['uri-id']; + + $items[$row['uri-id']] = $this->addRowInformation($row, [], []); + } + DBA::close($quotes); + $items = $this->convSort($items, $order); $this->profiler->stopRecording();