Simplyfied code
This commit is contained in:
parent
da65f0bea7
commit
1b13c76d2e
1 changed files with 27 additions and 31 deletions
|
@ -1324,8 +1324,7 @@ class Processor
|
||||||
public static function storeReceivers(int $uriid, array $receivers)
|
public static function storeReceivers(int $uriid, array $receivers)
|
||||||
{
|
{
|
||||||
foreach (['as:to' => Tag::TO, 'as:cc' => Tag::CC, 'as:bto' => Tag::BTO, 'as:bcc' => Tag::BCC, 'as:audience' => Tag::AUDIENCE, 'as:attributedTo' => Tag::ATTRIBUTED] as $element => $type) {
|
foreach (['as:to' => Tag::TO, 'as:cc' => Tag::CC, 'as:bto' => Tag::BTO, 'as:bcc' => Tag::BCC, 'as:audience' => Tag::AUDIENCE, 'as:attributedTo' => Tag::ATTRIBUTED] as $element => $type) {
|
||||||
if (!empty($receivers[$element])) {
|
foreach ($receivers[$element] ?? [] as $receiver) {
|
||||||
foreach ($receivers[$element] as $receiver) {
|
|
||||||
if ($receiver == ActivityPub::PUBLIC_COLLECTION) {
|
if ($receiver == ActivityPub::PUBLIC_COLLECTION) {
|
||||||
$name = Receiver::PUBLIC_COLLECTION;
|
$name = Receiver::PUBLIC_COLLECTION;
|
||||||
} elseif ($path = parse_url($receiver, PHP_URL_PATH)) {
|
} elseif ($path = parse_url($receiver, PHP_URL_PATH)) {
|
||||||
|
@ -1343,13 +1342,11 @@ class Processor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private static function storeCapabilities(int $uriid, array $capabilities)
|
private static function storeCapabilities(int $uriid, array $capabilities)
|
||||||
{
|
{
|
||||||
foreach (['pixelfed:canAnnounce' => Tag::CAN_ANNOUNCE, 'pixelfed:canLike' => Tag::CAN_LIKE, 'pixelfed:canReply' => Tag::CAN_REPLY] as $element => $type) {
|
foreach (['pixelfed:canAnnounce' => Tag::CAN_ANNOUNCE, 'pixelfed:canLike' => Tag::CAN_LIKE, 'pixelfed:canReply' => Tag::CAN_REPLY] as $element => $type) {
|
||||||
if (!empty($capabilities[$element])) {
|
foreach ($capabilities[$element] ?? [] as $capability) {
|
||||||
foreach ($capabilities[$element] as $capability) {
|
|
||||||
if ($capability == ActivityPub::PUBLIC_COLLECTION) {
|
if ($capability == ActivityPub::PUBLIC_COLLECTION) {
|
||||||
$name = Receiver::PUBLIC_COLLECTION;
|
$name = Receiver::PUBLIC_COLLECTION;
|
||||||
} elseif (empty($capability) || ($capability == '[]')) {
|
} elseif (empty($capability) || ($capability == '[]')) {
|
||||||
|
@ -1366,7 +1363,6 @@ class Processor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an mail post
|
* Creates an mail post
|
||||||
|
|
Loading…
Reference in a new issue