Replace reference to post plink by author base URL
- This is more reliably used to show the Ignore Author Server link
This commit is contained in:
parent
6fa7c23bb9
commit
f2c1ecd19b
|
@ -34,15 +34,16 @@ use Friendica\Core\Protocol;
|
||||||
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
|
use Friendica\DI;
|
||||||
use Friendica\Model\Attach;
|
use Friendica\Model\Attach;
|
||||||
|
use Friendica\Model\Circle;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Conversation;
|
use Friendica\Model\Conversation;
|
||||||
use Friendica\Model\FileTag;
|
use Friendica\Model\FileTag;
|
||||||
use Friendica\Model\Circle;
|
|
||||||
use Friendica\Model\Item as ItemModel;
|
use Friendica\Model\Item as ItemModel;
|
||||||
use Friendica\Model\Photo;
|
use Friendica\Model\Photo;
|
||||||
use Friendica\Model\Tag;
|
|
||||||
use Friendica\Model\Post;
|
use Friendica\Model\Post;
|
||||||
|
use Friendica\Model\Tag;
|
||||||
use Friendica\Model\User;
|
use Friendica\Model\User;
|
||||||
use Friendica\Network\HTTPException;
|
use Friendica\Network\HTTPException;
|
||||||
use Friendica\Object\EMail\ItemCCEMail;
|
use Friendica\Object\EMail\ItemCCEMail;
|
||||||
|
@ -50,11 +51,11 @@ use Friendica\Protocol\Activity;
|
||||||
use Friendica\Util\ACLFormatter;
|
use Friendica\Util\ACLFormatter;
|
||||||
use Friendica\Util\DateTimeFormat;
|
use Friendica\Util\DateTimeFormat;
|
||||||
use Friendica\Util\Emailer;
|
use Friendica\Util\Emailer;
|
||||||
use Friendica\Util\Network;
|
|
||||||
use Friendica\Util\ParseUrl;
|
use Friendica\Util\ParseUrl;
|
||||||
use Friendica\Util\Profiler;
|
use Friendica\Util\Profiler;
|
||||||
use Friendica\Util\Proxy;
|
use Friendica\Util\Proxy;
|
||||||
use Friendica\Util\XML;
|
use Friendica\Util\XML;
|
||||||
|
use GuzzleHttp\Psr7\Uri;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A content helper class for displaying items
|
* A content helper class for displaying items
|
||||||
|
@ -408,8 +409,9 @@ class Item
|
||||||
$collapse_link = $item['self'] ? '' : $contact_url . '/collapse?t=' . $formSecurityToken;
|
$collapse_link = $item['self'] ? '' : $contact_url . '/collapse?t=' . $formSecurityToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($item['author-gsid'])) {
|
$authorBaseUri = new Uri($item['author-baseurl'] ?? '');
|
||||||
$ignoreserver_link = Network::isLocalLink($contact_url) ? '' : 'settings/server/' . $item['author-gsid'] . '/ignore';
|
if (!empty($item['author-gsid']) && $authorBaseUri->getHost() && !DI::baseUrl()->isLocalUrl($authorBaseUri)) {
|
||||||
|
$ignoreserver_link = 'settings/server/' . $item['author-gsid'] . '/ignore';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($cid && !$item['self']) {
|
if ($cid && !$item['self']) {
|
||||||
|
|
|
@ -95,7 +95,7 @@ class Item
|
||||||
'wall', 'private', 'starred', 'origin', 'parent-origin', 'title', 'body', 'language',
|
'wall', 'private', 'starred', 'origin', 'parent-origin', 'title', 'body', 'language',
|
||||||
'content-warning', 'location', 'coord', 'app', 'rendered-hash', 'rendered-html', 'object',
|
'content-warning', 'location', 'coord', 'app', 'rendered-hash', 'rendered-html', 'object',
|
||||||
'quote-uri', 'quote-uri-id', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'mention', 'global',
|
'quote-uri', 'quote-uri-id', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'mention', 'global',
|
||||||
'author-id', 'author-link', 'author-alias', 'author-name', 'author-avatar', 'author-network', 'author-updated', 'author-gsid', 'author-addr', 'author-uri-id',
|
'author-id', 'author-link', 'author-alias', 'author-name', 'author-avatar', 'author-network', 'author-updated', 'author-gsid', 'author-baseurl', 'author-addr', 'author-uri-id',
|
||||||
'owner-id', 'owner-link', 'owner-alias', 'owner-name', 'owner-avatar', 'owner-network', 'owner-contact-type', 'owner-updated', 'owner-gsid',
|
'owner-id', 'owner-link', 'owner-alias', 'owner-name', 'owner-avatar', 'owner-network', 'owner-contact-type', 'owner-updated', 'owner-gsid',
|
||||||
'causer-id', 'causer-link', 'causer-alias', 'causer-name', 'causer-avatar', 'causer-contact-type', 'causer-network', 'causer-gsid',
|
'causer-id', 'causer-link', 'causer-alias', 'causer-name', 'causer-avatar', 'causer-contact-type', 'causer-network', 'causer-gsid',
|
||||||
'contact-id', 'contact-uid', 'contact-link', 'contact-name', 'contact-avatar',
|
'contact-id', 'contact-uid', 'contact-link', 'contact-name', 'contact-avatar',
|
||||||
|
|
|
@ -31,17 +31,15 @@ use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
use Friendica\Model\Photo;
|
|
||||||
use Friendica\Model\Post as PostModel;
|
use Friendica\Model\Post as PostModel;
|
||||||
use Friendica\Model\Tag;
|
use Friendica\Model\Tag;
|
||||||
use Friendica\Model\User;
|
use Friendica\Model\User;
|
||||||
use Friendica\Protocol\Activity;
|
use Friendica\Protocol\Activity;
|
||||||
use Friendica\Util\Crypto;
|
use Friendica\Util\Crypto;
|
||||||
use Friendica\Util\DateTimeFormat;
|
use Friendica\Util\DateTimeFormat;
|
||||||
use Friendica\Util\Network;
|
|
||||||
use Friendica\Util\Proxy;
|
|
||||||
use Friendica\Util\Strings;
|
use Friendica\Util\Strings;
|
||||||
use Friendica\Util\Temporal;
|
use Friendica\Util\Temporal;
|
||||||
|
use GuzzleHttp\Psr7\Uri;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -284,7 +282,8 @@ class Post
|
||||||
'label' => DI::l10n()->t('Report post'),
|
'label' => DI::l10n()->t('Report post'),
|
||||||
'href' => 'moderation/report/create?' . http_build_query(['cid' => $item['author-id'], 'uri-ids' => [$item['uri-id']]]),
|
'href' => 'moderation/report/create?' . http_build_query(['cid' => $item['author-id'], 'uri-ids' => [$item['uri-id']]]),
|
||||||
];
|
];
|
||||||
if (!Network::isLocalLink($item['plink'])) {
|
$authorBaseUri = new Uri($item['author-baseurl'] ?? '');
|
||||||
|
if ($authorBaseUri->getHost() && !DI::baseUrl()->isLocalUrl($authorBaseUri)) {
|
||||||
$ignoreServer = [
|
$ignoreServer = [
|
||||||
'label' => DI::l10n()->t("Ignore %s's server", $item['author-name']),
|
'label' => DI::l10n()->t("Ignore %s's server", $item['author-name']),
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user