namespace Friendica\Model;
+use Friendica\Contact\LocalRelationship\Entity\LocalRelationship;
use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\HTML;
use Friendica\Core\Hook;
return;
}
- $cdata = Contact::getPublicAndUserContactID($item['author-id'], $item['uid']);
- if (empty($cdata['user']) || ($cdata['user'] != $item['contact-id'])) {
+ if (!DBA::exists('contact', ['id' => $cdata['user'], 'remote_self' => LocalRelationship::MIRROR_NATIVE_RESHARE])) {
return;
}
- if (!DBA::exists('contact', ['id' => $cdata['user'], 'remote_self' => Contact::MIRROR_NATIVE_RESHARE])) {
+ if (!in_array($item['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN])) {
return;
}
- if (!in_array($item['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN])) {
+ if (User::getById($item['uid'], ['blocked'])['blocked'] ?? false) {
return;
}
public static function isRemoteSelf(array $contact, array &$datarray): bool
{
- if ($contact['remote_self'] != Contact::MIRROR_OWN_POST) {
+ if ($contact['remote_self'] != LocalRelationship::MIRROR_OWN_POST) {
return false;
}
return false;
}
+ if (User::getById($contact['uid'], ['blocked'])['blocked'] ?? false) {
+ Logger::info('User is blocked', ['contact' => $contact]);
+ return false;
+ }
+
$datarray2 = $datarray;
Logger::info('remote-self start', ['contact' => $contact['url'], 'remote_self' => $contact['remote_self'], 'item' => $datarray]);
$shared_html = substr($s, $pos + strlen(BBCode::SHARED_ANCHOR));
$s = substr($s, 0, $pos);
}
-
+
$s = self::addGallery($s, $attachments, $item['uri-id']);
$s = self::addVisualAttachments($attachments, $item, $s, false);
$s = self::addLinkAttachment($item['uri-id'], $attachments, $body, $s, false, $shared_links);
}
$author = [
- 'uid' => 0,
+ 'uid' => 0,
'id' => $item['author-id'],
- 'network' => $item['author-network'],
+ 'network' => $item['author-network'],
'url' => $item['author-link'],
'alias' => $item['author-alias']
];
if (!empty($plink) && ($item['private'] == self::PRIVATE)) {
$author = [
- 'uid' => 0,
+ 'uid' => 0,
'id' => $item['author-id'],
- 'network' => $item['author-network'],
+ 'network' => $item['author-network'],
'url' => $item['author-link'],
'alias' => $item['author-alias'],
];