use Friendica\Util\HTTPSignature;
use Friendica\Util\JsonLD;
use Friendica\Util\Network;
+use GuzzleHttp\Psr7\Uri;
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');
if (strlen($apcontact['photo']) > 255) {
$parts = parse_url($apcontact['photo']);
unset($parts['fragment']);
- $apcontact['photo'] = Network::unparseURL($parts);
+ $apcontact['photo'] = (string)Uri::fromParts($parts);
if (strlen($apcontact['photo']) > 255) {
unset($parts['query']);
- $apcontact['photo'] = Network::unparseURL($parts);
+ $apcontact['photo'] = (string)Uri::fromParts($parts);
}
if (strlen($apcontact['photo']) > 255) {
HTTPSignature::setInboxStatus($url, true, $shared);
}
+ /**
+ * Check if the apcontact is a relay account
+ *
+ * @param array $apcontact
+ *
+ * @return bool
+ */
public static function isRelay(array $apcontact): bool
{
if ($apcontact['nick'] != 'relay') {
return true;
}
- if (in_array($apcontact['type'], ['Group', 'Service']) && ($apcontact['nick'] == 'relay') && is_null($apcontact['outbox'])) {
+ if (in_array($apcontact['type'], ['Group', 'Service']) && is_null($apcontact['outbox'])) {
return true;
}