summaryrefslogtreecommitdiffstats
path: root/lib/Model
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2019-01-15 09:35:06 -0100
committerMaxence Lange <maxence@artificial-owl.com>2019-01-15 09:35:06 -0100
commit58907143070e67ccb246b7dc4756ec47d58d9dd1 (patch)
tree8c2c922638c4cdda1a63527f69cc5991625787f1 /lib/Model
parent6ad5dcfd12d991be6d08c315368651c5de6ae450 (diff)
add w3 @context in actor
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/Model')
-rw-r--r--lib/Model/ActivityPub/ACore.php23
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/Model/ActivityPub/ACore.php b/lib/Model/ActivityPub/ACore.php
index da3c92a8..4cac3361 100644
--- a/lib/Model/ActivityPub/ACore.php
+++ b/lib/Model/ActivityPub/ACore.php
@@ -73,6 +73,8 @@ class ACore extends Item implements JsonSerializable {
/** @var Document */
private $icon = null;
+ /** @var bool */
+ private $displayW3ContextSecurity = false;
/** @var LinkedDataSignature */
private $signature = null;
@@ -174,6 +176,25 @@ class ACore extends Item implements JsonSerializable {
/**
* @return bool
*/
+ public function isDisplayW3ContextSecurity(): bool {
+ return $this->displayW3ContextSecurity;
+ }
+
+ /**
+ * @param bool $display
+ *
+ * @return ACore
+ */
+ public function setDisplayW3ContextSecurity(bool $display): ACore {
+ $this->displayW3ContextSecurity = $display;
+
+ return $this;
+ }
+
+
+ /**
+ * @return bool
+ */
public function gotSignature(): bool {
return ($this->signature !== null);
}
@@ -538,7 +559,7 @@ class ACore extends Item implements JsonSerializable {
if ($this->isRoot()) {
$context = [self::CONTEXT_ACTIVITYSTREAMS];
- if ($this->gotSignature()) {
+ if ($this->gotSignature() || $this->isDisplayW3ContextSecurity()) {
array_push($context, self::CONTEXT_SECURITY);
}