'url' => $activity['author-link']
];
$url = Contact::magicLinkByContact($author);
- if (strpos($url, 'redir/') === 0) {
+ if (strpos($url, 'contact/redir/') === 0) {
$sparkle = ' class="sparkle" ';
}
if (!$update) {
$live_update_div = '<div id="live-notes"></div>' . "\r\n"
. "<script> var profile_uid = " . $this->session->getLocalUserId()
- . "; var netargs = '/?f='; </script>\r\n";
+ . "; var netargs = '?f='; </script>\r\n";
}
} elseif ($mode === 'display') {
$items = $this->addChildren($items, false, $order, $uid, $mode);
if (!$update) {
$live_update_div = '<div id="live-contact"></div>' . "\r\n"
. "<script> var profile_uid = -1; var netargs = '" . substr($this->args->getCommand(), 8)
- ."/?f='; </script>\r\n";
+ ."?f='; </script>\r\n";
}
} elseif ($mode === 'search') {
$live_update_div = '<div id="live-search"></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();
$profile_link = Contact::magicLinkByContact($author);
$sparkle = '';
- if (strpos($profile_link, 'redir/') === 0) {
+ if (strpos($profile_link, 'contact/redir/') === 0) {
$sparkle = ' sparkle';
}
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 [];
}
}
$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']]);
$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)) {
}
}
+ 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();