}
if (!($fields = self::validPosting($msg))) {
- Logger::warning('Invalid posting');
+ Logger::warning('Invalid posting', ['msg' => $msg]);
return false;
}
if (is_null($fields)) {
$private = true;
if (!($fields = self::validPosting($msg))) {
- Logger::warning('Invalid posting');
+ Logger::warning('Invalid posting', ['msg' => $msg]);
return false;
}
} else {
*/
public static function isSupportedByContactUrl(string $url, ?bool $update = null): bool
{
- $contact = Contact::getByURL($url, $update);
+ $contact = Contact::getByURL($url, $update, ['uri-id', 'network']);
- return DI::dsprContact()->existsByUriId($contact['uri-id'] ?? 0);
+ $supported = DI::dsprContact()->existsByUriId($contact['uri-id'] ?? 0);
+
+ if (!$supported && is_null($update) && ($contact['network'] == Protocol::DFRN)) {
+ $supported = self::isSupportedByContactUrl($url, true);
+ }
+
+ return $supported;
}
/**
$body = '### ' . html_entity_decode($title) . "\n\n" . $body;
}
- $attachments = Post\Media::getByURIId($item['uri-id'], [Post\Media::DOCUMENT, Post\Media::TORRENT, Post\Media::UNKNOWN]);
+ $attachments = Post\Media::getByURIId($item['uri-id'], [Post\Media::DOCUMENT, Post\Media::TORRENT]);
if (!empty($attachments)) {
$body .= "\n[hr]\n";
foreach ($attachments as $attachment) {
return false;
}
- if (!self::isSupportedByContactUrl($parent_post['author-link'], false)) {
+ if (!self::isSupportedByContactUrl($parent_post['author-link'])) {
Logger::info('Parent author is no Diaspora contact.', ['parent-id' => $parent_id]);
return false;
}