<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
* the appropriate link.
*
* @param string $body the text to replace the tag in
- * @param string $inform a comma-seperated string containing everybody to inform
* @param integer $profile_uid the user id to replace the tag for (0 = anyone)
* @param string $tag the tag to replace
* @param string $network The network of the post
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
- public static function replaceTag(&$body, &$inform, $profile_uid, $tag, $network = '')
+ public static function replaceTag(&$body, $profile_uid, $tag, $network = '')
{
$replaced = false;
// Check if $contact has been successfully loaded
if (DBA::isResult($contact)) {
- if (strlen($inform) && (isset($contact['notify']) || isset($contact['id']))) {
- $inform .= ',';
- }
-
- if (isset($contact['id'])) {
- $inform .= 'cid:' . $contact['id'];
- } elseif (isset($contact['notify'])) {
- $inform .= $contact['notify'];
- }
-
$profile = $contact['url'];
$newname = ($contact['name'] ?? '') ?: $contact['nick'];
}
// add sparkle links to appropriate permalinks
// Only create a redirection to a magic link when logged in
- if (!empty($item['plink']) && Session::isAuthenticated()) {
+ if (!empty($item['plink']) && Session::isAuthenticated() && $item['private'] == ModelItem::PRIVATE) {
$author = ['uid' => 0, 'id' => $item['author-id'],
'network' => $item['author-network'], 'url' => $item['author-link']];
$item['plink'] = Contact::magicLinkByContact($author, $item['plink']);