Improved message handling / new activity relay handling

This commit is contained in:
Michael 2022-07-27 17:39:00 +00:00
parent 7834359957
commit 86105635ca
26 changed files with 280 additions and 428 deletions

View file

@ -38,6 +38,7 @@ use Friendica\Util\DateTimeFormat;
use Friendica\Util\HTTPSignature;
use Friendica\Util\JsonLD;
use Friendica\Util\Network;
use GuzzleHttp\Psr7\Uri;
class APContact
{
@ -310,6 +311,8 @@ class APContact
$apcontact['manually-approve'] = (int)JsonLD::fetchElement($compacted, 'as:manuallyApprovesFollowers');
$apcontact['suspended'] = (int)JsonLD::fetchElement($compacted, 'toot:suspended');
if (!empty($compacted['as:generator'])) {
$apcontact['baseurl'] = JsonLD::fetchElement($compacted['as:generator'], 'as:url', '@id');
$apcontact['generator'] = JsonLD::fetchElement($compacted['as:generator'], 'as:name', '@value');
@ -380,11 +383,11 @@ class APContact
if (strlen($apcontact['photo']) > 255) {
$parts = parse_url($apcontact['photo']);
unset($parts['fragment']);
$apcontact['photo'] = Network::unparseURL($parts);
$apcontact['photo'] = Uri::fromParts($parts);
if (strlen($apcontact['photo']) > 255) {
unset($parts['query']);
$apcontact['photo'] = Network::unparseURL($parts);
$apcontact['photo'] = Uri::fromParts($parts);
}
if (strlen($apcontact['photo']) > 255) {