Issue 7771: Funkwhale support

This commit is contained in:
Michael 2020-03-24 23:12:53 +00:00
parent 103769f4c2
commit 1fef1ef6e9
3 changed files with 9 additions and 1 deletions

View file

@ -26,6 +26,7 @@ use Friendica\Core\Logger;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Protocol\ActivityPub;
use Friendica\Util\Crypto;
use Friendica\Util\Network;
use Friendica\Util\JsonLD;
use Friendica\Util\DateTimeFormat;
@ -209,6 +210,9 @@ class APContact
$apcontact['pubkey'] = null;
if (!empty($compacted['w3id:publicKey'])) {
$apcontact['pubkey'] = trim(JsonLD::fetchElement($compacted['w3id:publicKey'], 'w3id:publicKeyPem', '@value'));
if (strstr($apcontact['pubkey'], 'RSA ')) {
$apcontact['pubkey'] = Crypto::rsaToPem($apcontact['pubkey']);
}
}
$apcontact['manually-approve'] = (int)JsonLD::fetchElement($compacted, 'as:manuallyApprovesFollowers');