X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fconversation.php;h=47adfc0dfbf971dec2677a46669d091b9db249e7;hb=91ef9f238cd79f1546d03a557753eec2c7d09327;hp=0362e9a4459f1d9730e13f4148b37cc6fb84660d;hpb=d2b5f77be9c8acb9f6898e65ea4592e747f2ea5c;p=friendica.git diff --git a/include/conversation.php b/include/conversation.php index 0362e9a445..47adfc0dfb 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -6,10 +6,12 @@ use Friendica\App; use Friendica\Content\ContactSelector; use Friendica\Content\Feature; +use Friendica\Content\Pager; use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; +use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Core\Protocol; use Friendica\Core\System; @@ -353,7 +355,8 @@ function localize_item(&$item) $author = ['uid' => 0, 'id' => $item['author-id'], 'network' => $item['author-network'], 'url' => $item['author-link']]; - if (!empty($item['plink'])) { + // Only create a redirection to a magic link when logged in + if (!empty($item['plink']) && (local_user() || remote_user())) { $item['plink'] = Contact::magicLinkbyContact($author, $item['plink']); } } @@ -432,8 +435,8 @@ function conv_get_blocklist() * that are based on unique features of the calling module. * */ -function conversation(App $a, array $items, $mode, $update, $preview = false, $order = 'commented', $uid = 0) { - +function conversation(App $a, array $items, Pager $pager, $mode, $update, $preview = false, $order = 'commented', $uid = 0) +{ $ssl_state = (local_user() ? true : false); $profile_owner = 0; @@ -468,7 +471,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o . ((x($_GET, 'cmax')) ? '&cmax=' . $_GET['cmax'] : '') . ((x($_GET, 'file')) ? '&file=' . $_GET['file'] : '') - . "'; var profile_page = " . $a->pager['page'] . "; \r\n"; + . "'; var profile_page = " . $pager->getPage() . "; \r\n"; } } elseif ($mode === 'profile') { $items = conversation_add_children($items, false, $order, $uid); @@ -487,7 +490,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o $live_update_div = '
' . "\r\n" . "\r\n"; + . "; var netargs = '?f='; var profile_page = " . $pager->getPage() . "; \r\n"; } } } elseif ($mode === 'notes') { @@ -497,7 +500,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o if (!$update) { $live_update_div = '
' . "\r\n" . "\r\n"; + . "; var netargs = '/?f='; var profile_page = " . $pager->getPage() . "; \r\n"; } } elseif ($mode === 'display') { $items = conversation_add_children($items, false, $order, $uid); @@ -515,7 +518,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o if (!$update) { $live_update_div = '
' . "\r\n" . "\r\n"; + ."/?f='; var profile_page = " . $pager->getPage() . "; \r\n"; } } elseif ($mode === 'contacts') { $items = conversation_add_children($items, true, $order, $uid); @@ -524,7 +527,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o if (!$update) { $live_update_div = '
' . "\r\n" . "\r\n"; + ."/?f='; var profile_page = " . $pager->getPage() . "; \r\n"; } } elseif ($mode === 'search') { $live_update_div = '' . "\r\n"; @@ -533,7 +536,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o $page_dropping = ((local_user() && local_user() == $profile_owner) ? true : false); if (!$update) { - $_SESSION['return_url'] = $a->query_string; + $_SESSION['return_path'] = $a->query_string; } $cb = ['items' => $items, 'mode' => $mode, 'update' => $update, 'preview' => $preview]; @@ -749,7 +752,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o $threads = $conv->getTemplateData($conv_responses); if (!$threads) { - logger('[ERROR] conversation : Failed to get template data.', LOGGER_DEBUG); + Logger::log('[ERROR] conversation : Failed to get template data.', LOGGER_DEBUG); $threads = []; } } @@ -853,8 +856,8 @@ function item_photo_menu($item) { if ($cid && !$item['self']) { $poke_link = 'poke/?f=&c=' . $cid; - $contact_url = 'contacts/' . $cid; - $posts_link = 'contacts/' . $cid . '/posts'; + $contact_url = 'contact/' . $cid; + $posts_link = 'contact/' . $cid . '/posts'; if (in_array($network, [Protocol::DFRN, Protocol::DIASPORA])) { $pm_url = 'message/new/' . $cid;