summaryrefslogtreecommitdiffstats
path: root/lib/Model/ActivityPub/ACore.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Model/ActivityPub/ACore.php')
-rw-r--r--lib/Model/ActivityPub/ACore.php13
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()