diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2019-06-20 22:59:40 -0100 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2019-06-20 22:59:40 -0100 |
commit | a1221cacf6dc9dbdffc1929f361e9c2e942c049d (patch) | |
tree | 51977745153fb5ba074d01773e47c219d11dfeec /lib/Model/ActivityPub/ACore.php | |
parent | 74a2f80209733543c48035184c2321158a0e2da3 (diff) |
new announce system
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
gotActor->hasActor
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
cleaning
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
retrieve Person if missing
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
fix async
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
avoid async duplicate
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
fixing
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/Model/ActivityPub/ACore.php')
-rw-r--r-- | lib/Model/ActivityPub/ACore.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/Model/ActivityPub/ACore.php b/lib/Model/ActivityPub/ACore.php index 89515e11..27c43ae7 100644 --- a/lib/Model/ActivityPub/ACore.php +++ b/lib/Model/ActivityPub/ACore.php @@ -38,8 +38,8 @@ use OCA\Social\Exceptions\ActivityCantBeVerifiedException; use OCA\Social\Exceptions\InvalidOriginException; use OCA\Social\Exceptions\InvalidResourceEntryException; use OCA\Social\Exceptions\UrlCloudException; -use OCA\Social\Model\LinkedDataSignature; use OCA\Social\Model\ActivityPub\Object\Document; +use OCA\Social\Model\LinkedDataSignature; class ACore extends Item implements JsonSerializable { @@ -225,6 +225,15 @@ class ACore extends Item implements JsonSerializable { /** * @return bool */ + public function isPublic(): bool { + return ($this->getTo() === self::CONTEXT_PUBLIC + || in_array(self::CONTEXT_PUBLIC, $this->getCcArray())); + } + + + /** + * @return bool + */ public function gotSignature(): bool { return ($this->signature !== null); } @@ -635,7 +644,7 @@ class ACore extends Item implements JsonSerializable { $this->addEntryArray('to', $this->getToArray()); $this->addEntryArray('cc', $this->getCcArray()); - if ($this->gotActor()) { + if ($this->hasActor()) { $this->addEntry( 'actor', $this->getActor() ->getId() |