[PLUGIN][ActivityPub][Postman] JSON_UNESCAPED_SLASHES

Only record webfinger matches for acct
This commit is contained in:
Diogo Peralta Cordeiro 2022-02-25 13:52:21 +00:00
parent 26a50618b0
commit b630d530f4
No known key found for this signature in database
GPG Key ID: 18D2D35001FBFAB0
5 changed files with 11 additions and 9 deletions

View File

@ -333,11 +333,13 @@ class ActivityPub extends Plugin
} else {
array_push($delivered, ...$dummy);
foreach ($dummy as $actor) {
FreeNetworkActorProtocol::protocolSucceeded(
'activitypub',
$actor,
Discovery::normalize($actor->getNickname() . '@' . parse_url($inbox, \PHP_URL_HOST)),
);
if ($actor->isPerson()) {
FreeNetworkActorProtocol::protocolSucceeded(
'activitypub',
$actor,
Discovery::normalize($actor->getNickname() . '@' . parse_url($inbox, \PHP_URL_HOST)),
);
}
}
}
} catch (Exception $e) {

View File

@ -121,7 +121,7 @@ abstract class Model
*
* @throws ClientException
*/
public static function toJson(mixed $object, ?int $options = null): string
public static function toJson(mixed $object, int $options = \JSON_UNESCAPED_SLASHES): string
{
switch ($object::class) {
case \App\Entity\Activity::class:

View File

@ -145,7 +145,7 @@ class Activity extends Model
*
* @throws ClientException
*/
public static function toJson(mixed $object, ?int $options = null): string
public static function toJson(mixed $object, int $options = \JSON_UNESCAPED_SLASHES): string
{
if ($object::class !== GSActivity::class) {
throw new InvalidArgumentException('First argument type must be an Activity.');

View File

@ -203,7 +203,7 @@ class Actor extends Model
*
* @throws ServerException
*/
public static function toJson(mixed $object, ?int $options = null): string
public static function toJson(mixed $object, int $options = \JSON_UNESCAPED_SLASHES): string
{
if ($object::class !== GSActor::class) {
throw new InvalidArgumentException('First argument type must be an Actor.');

View File

@ -337,7 +337,7 @@ class Note extends Model
* @throws InvalidArgumentException
* @throws ServerException
*/
public static function toJson(mixed $object, ?int $options = null): string
public static function toJson(mixed $object, int $options = \JSON_UNESCAPED_SLASHES): string
{
if ($object::class !== GSNote::class) {
throw new InvalidArgumentException('First argument type must be a Note.');