use Friendica\Object\Thread;
use Friendica\Protocol\Activity;
use Friendica\Util\Crypto;
use Friendica\Object\Thread;
use Friendica\Protocol\Activity;
use Friendica\Util\Crypto;
$item['body'] = item_redir_and_replace_images($extracted['body'], $extracted['images'], $item['contact-id']);
}
$item['body'] = item_redir_and_replace_images($extracted['body'], $extracted['images'], $item['contact-id']);
}
- $A = '[url=' . Contact::magicLink($Alink) . ']' . $Aname . '[/url]';
- $B = '[url=' . Contact::magicLink($Blink) . ']' . $Bname . '[/url]';
- if ($Bphoto != "") {
+ $author = ['uid' => 0, 'id' => $item['author-id'],
+ 'network' => $item['author-network'], 'url' => $item['author-link']];
+ $A = '[url=' . Contact::magicLinkByContact($author) . ']' . $item['author-name'] . '[/url]';
+
+ if (!empty($Blink)) {
+ $B = '[url=' . Contact::magicLink($Blink) . ']' . $Bname . '[/url]';
+ } else {
+ $B = '';
+ }
+
+ if ($Bphoto != "" && !empty($Blink)) {
// Only create a redirection to a magic link when logged in
if (!empty($item['plink']) && Session::isAuthenticated()) {
// Only create a redirection to a magic link when logged in
if (!empty($item['plink']) && Session::isAuthenticated()) {
$row = array_merge($row, $activity);
$contact = Contact::getById($activity['causer-id'], ['url', 'name', 'thumb']);
$row['causer-link'] = $contact['url'];
$row = array_merge($row, $activity);
$contact = Contact::getById($activity['causer-id'], ['url', 'name', 'thumb']);
$row['causer-link'] = $contact['url'];
$row['direction'] = ['direction' => 7, 'title' => DI::l10n()->t('You had been addressed (%s).', 'to')];
break;
$row['direction'] = ['direction' => 7, 'title' => DI::l10n()->t('You had been addressed (%s).', 'to')];
break;
$row['direction'] = ['direction' => 7, 'title' => DI::l10n()->t('You had been addressed (%s).', 'cc')];
break;
$row['direction'] = ['direction' => 7, 'title' => DI::l10n()->t('You had been addressed (%s).', 'cc')];
break;
$row['direction'] = ['direction' => 7, 'title' => DI::l10n()->t('You had been addressed (%s).', 'bto')];
break;
$row['direction'] = ['direction' => 7, 'title' => DI::l10n()->t('You had been addressed (%s).', 'bto')];
break;
$row['direction'] = ['direction' => 7, 'title' => DI::l10n()->t('You had been addressed (%s).', 'bcc')];
break;
$row['direction'] = ['direction' => 7, 'title' => DI::l10n()->t('You had been addressed (%s).', 'bcc')];
break;
$row['direction'] = ['direction' => 6, 'title' => DI::l10n()->t('You are following %s.', $row['author-name'])];
break;
$row['direction'] = ['direction' => 6, 'title' => DI::l10n()->t('You are following %s.', $row['author-name'])];
break;
if (!empty($row['causer-id']) && DI::pConfig()->get(local_user(), 'system', 'display_resharer')) {
$row['owner-id'] = $row['causer-id'];
$row['owner-link'] = $row['causer-link'];
if (!empty($row['causer-id']) && DI::pConfig()->get(local_user(), 'system', 'display_resharer')) {
$row['owner-id'] = $row['causer-id'];
$row['owner-link'] = $row['causer-link'];
- $row['reshared'] = DI::l10n()->t('%s reshared this.', '<a href="'. htmlentities(Contact::magicLinkById($row['causer-id'])) .'">' . htmlentities($name) . '</a>');
+ $causer = ['uid' => 0, 'id' => $row['causer-id'],
+ 'network' => $row['causer-network'], 'url' => $row['causer-link']];
+ $row['reshared'] = DI::l10n()->t('%s reshared this.', '<a href="'. htmlentities(Contact::magicLinkByContact($causer)) .'">' . htmlentities($name) . '</a>');
}
$row['direction'] = ['direction' => 3, 'title' => (empty($row['causer-id']) ? DI::l10n()->t('Reshared') : DI::l10n()->t('Reshared by %s', $name))];
break;
}
$row['direction'] = ['direction' => 3, 'title' => (empty($row['causer-id']) ? DI::l10n()->t('Reshared') : DI::l10n()->t('Reshared by %s', $name))];
break;
$row['direction'] = ['direction' => 5, 'title' => DI::l10n()->t('%s is participating in this thread.', $row['author-name'])];
break;
$row['direction'] = ['direction' => 5, 'title' => DI::l10n()->t('%s is participating in this thread.', $row['author-name'])];
break;
$row['direction'] = ['direction' => 10, 'title' => (empty($row['causer-id']) ? DI::l10n()->t('Relayed') : DI::l10n()->t('Relayed by %s.', $name))];
break;
$row['direction'] = ['direction' => 10, 'title' => (empty($row['causer-id']) ? DI::l10n()->t('Relayed') : DI::l10n()->t('Relayed by %s.', $name))];
break;
$row['direction'] = ['direction' => 2, 'title' => (empty($row['causer-id']) ? DI::l10n()->t('Fetched') : DI::l10n()->t('Fetched because of %s', $name))];
break;
}
$row['direction'] = ['direction' => 2, 'title' => (empty($row['causer-id']) ? DI::l10n()->t('Fetched') : DI::l10n()->t('Fetched because of %s', $name))];
break;
}
foreach ($parents AS $parent) {
if (!empty($parent['thr-parent-id']) && !empty($parent['gravity']) && ($parent['gravity'] == GRAVITY_ACTIVITY)) {
foreach ($parents AS $parent) {
if (!empty($parent['thr-parent-id']) && !empty($parent['gravity']) && ($parent['gravity'] == GRAVITY_ACTIVITY)) {
$parent['thr-parent-id'], $uid, Verb::getID(Activity::FOLLOW)];
if (!empty($parent['author-id'])) {
$activity = ['causer-id' => $parent['author-id']];
foreach (['commented', 'received', 'created'] as $orderfields) {
if (!empty($parent[$orderfields])) {
$parent['thr-parent-id'], $uid, Verb::getID(Activity::FOLLOW)];
if (!empty($parent['author-id'])) {
$activity = ['causer-id' => $parent['author-id']];
foreach (['commented', 'received', 'created'] as $orderfields) {
if (!empty($parent[$orderfields])) {
- $condition = ["`item`.`parent-uri` = ? AND `item`.`uid` IN (0, ?) AND (`vid` != ? OR `vid` IS NULL)",
- $parent['uri'], $uid, Verb::getID(Activity::FOLLOW)];
+ $condition = ["`parent-uri-id` = ? AND `uid` IN (0, ?) AND (`vid` != ? OR `vid` IS NULL)",
+ $parent['uri-id'], $uid, Verb::getID(Activity::FOLLOW)];
$activity = [];
}
$items = conversation_fetch_items($parent, $items, $condition, $block_authors, $params, $activity);
$activity = [];
}
$items = conversation_fetch_items($parent, $items, $condition, $block_authors, $params, $activity);
*/
function conversation_fetch_items(array $parent, array $items, array $condition, bool $block_authors, array $params, array $activity) {
if ($block_authors) {
*/
function conversation_fetch_items(array $parent, array $items, array $condition, bool $block_authors, array $params, array $activity) {
if ($block_authors) {
- $thread_items = Item::selectForUser(local_user(), array_merge(Item::DISPLAY_FIELDLIST, ['pinned', 'contact-uid', 'gravity', 'post-type']), $condition, $params);
+ $thread_items = Post::selectForUser(local_user(), array_merge(Item::DISPLAY_FIELDLIST, ['pinned', 'contact-uid', 'gravity', 'post-type', 'post-reason']), $condition, $params);
- if (local_user() && local_user() == $item['uid'] && $item['gravity'] == GRAVITY_PARENT && !$item['self']) {
- $sub_link = 'javascript:dosubthread(' . $item['id'] . '); return false;';
+ if (local_user() && local_user() == $item['uid'] && $item['gravity'] == GRAVITY_PARENT && !$item['self'] && !$item['mention']) {
+ $sub_link = 'javascript:doFollowThread(' . $item['id'] . '); return false;';
- $block_link = $contact_url . '/block';
- $ignore_link = $contact_url . '/ignore';
+ $block_link = $item['self'] ? '' : $contact_url . '/block';
+ $ignore_link = $item['self'] ? '' : $contact_url . '/ignore';
if (strpos($v, 'javascript:') === 0) {
$v = substr($v, 11);
$o .= '<li role="menuitem"><a onclick="' . $v . '">' . $k . '</a></li>' . PHP_EOL;
if (strpos($v, 'javascript:') === 0) {
$v = substr($v, 11);
$o .= '<li role="menuitem"><a onclick="' . $v . '">' . $k . '</a></li>' . PHP_EOL;
- if (!isset($conv_responses[$mode][$activity['thr-parent']])) {
- $conv_responses[$mode][$activity['thr-parent']] = [
+ if (!isset($conv_responses[$mode][$activity['thr-parent-id']])) {
+ $conv_responses[$mode][$activity['thr-parent-id']] = [
'$edimg' => DI::l10n()->t('Image'),
'$edurl' => DI::l10n()->t('Link'),
'$edattach' => DI::l10n()->t('Link or Media'),
'$edimg' => DI::l10n()->t('Image'),
'$edurl' => DI::l10n()->t('Link'),
'$edattach' => DI::l10n()->t('Link or Media'),
'$setloc' => DI::l10n()->t('Set your location'),
'$shortsetloc' => DI::l10n()->t('set location'),
'$noloc' => DI::l10n()->t('Clear browser location'),
'$setloc' => DI::l10n()->t('Set your location'),
'$shortsetloc' => DI::l10n()->t('set location'),
'$noloc' => DI::l10n()->t('Clear browser location'),