Merge remote-tracking branch 'upstream/develop' into audience

This commit is contained in:
Michael 2023-04-23 21:20:01 +00:00
commit 69e4254dcc
51 changed files with 656 additions and 573 deletions

View file

@ -97,6 +97,8 @@ class BaseSearch extends BaseModule
} elseif (Search::getGlobalDirectory() && empty($results)) {
$results = Search::getContactsFromGlobalDirectory($search, $type, $pager->getPage());
$pager->setItemsPerPage($results->getItemsPage());
} else {
$results = new ResultList();
}
return self::printResult($results, $pager, $header);
@ -120,11 +122,17 @@ class BaseSearch extends BaseModule
return '';
}
$filtered = 0;
$entries = [];
foreach ($results->getResults() as $result) {
// in case the result is a contact result, add a contact-specific entry
if ($result instanceof ContactResult) {
if (Network::isUriBlocked($result->getUrl())) {
$filtered++;
continue;
}
$contact = Model\Contact::getByURLForUser($result->getUrl(), DI::userSession()->getLocalUserId());
if (!empty($contact)) {
$entries[] = Contact::getContactTemplateVars($contact);
@ -134,7 +142,11 @@ class BaseSearch extends BaseModule
$tpl = Renderer::getMarkupTemplate('contact/list.tpl');
return Renderer::replaceMacros($tpl, [
'title' => $header,
'$title' => $header,
'$filtered' => $filtered ? DI::l10n()->tt(
'%d result was filtered out because your node blocks the domain it is registered on. You can review the list of domains your node is currently blocking in the <a href="/friendica">About page</a>.',
'%d results were filtered out because your node blocks the domain they are registered on. You can review the list of domains your node is currently blocking in the <a href="/friendica">About page</a>.',
$filtered) : '',
'$contacts' => $entries,
'$paginate' => $pager->renderFull($results->getTotal()),
]);

View file

@ -343,7 +343,7 @@ class Install extends BaseModule
*/
private function whatNext(): string
{
$baseurl = $this->baseUrl;
$baseurl = (string)$this->baseUrl;
return
$this->t('<h1>What next</h1>')
. "<p>" . $this->t('IMPORTANT: You will need to [manually] setup a scheduled task for the worker.')

View file

@ -68,7 +68,7 @@ class Share extends \Friendica\BaseModule
$shared = $this->contentItem->getSharedPost($item, ['uri']);
if ($shared && empty($shared['comment'])) {
$content = '[share]' . $shared['post']['uri'] . '[/share]';
} elseif ($item['network'] == Protocol::FEED) {
} elseif (!empty($item['plink']) && !in_array($item['network'], Protocol::FEDERATED)) {
$content = '[attachment]' . $item['plink'] . '[/attachment]';
} else {
$content = '[share]' . $item['uri'] . '[/share]';

View file

@ -232,7 +232,7 @@ class Import extends \Friendica\BaseModule
}
$oldBaseUrl = $account['baseurl'];
$newBaseUrl = $this->baseUrl;
$newBaseUrl = (string)$this->baseUrl;
$oldAddr = str_replace('http://', '@', Strings::normaliseLink($oldBaseUrl));
$newAddr = str_replace('http://', '@', Strings::normaliseLink($newBaseUrl));

View file

@ -105,7 +105,7 @@ class Xrd extends BaseModule
private function printSystemJSON(array $owner)
{
$baseURL = $this->baseUrl;
$baseURL = (string)$this->baseUrl;
$json = [
'subject' => 'acct:' . $owner['addr'],
'aliases' => [$owner['url']],
@ -151,7 +151,7 @@ class Xrd extends BaseModule
private function printJSON(string $alias, array $owner, array $avatar)
{
$baseURL = $this->baseUrl;
$baseURL = (string)$this->baseUrl;
$json = [
'subject' => 'acct:' . $owner['addr'],
@ -228,7 +228,7 @@ class Xrd extends BaseModule
private function printXML(string $alias, array $owner, array $avatar)
{
$baseURL = $this->baseUrl;
$baseURL = (string)$this->baseUrl;
$xmlString = XML::fromArray([
'XRD' => [