summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Controller/ActivityPubController.php3
-rw-r--r--lib/Model/ActivityPub/ACore.php23
2 files changed, 23 insertions, 3 deletions
diff --git a/lib/Controller/ActivityPubController.php b/lib/Controller/ActivityPubController.php
index 30f12454..e4915d45 100644
--- a/lib/Controller/ActivityPubController.php
+++ b/lib/Controller/ActivityPubController.php
@@ -122,8 +122,7 @@ class ActivityPubController extends Controller {
try {
$actor = $this->cacheActorService->getFromLocalAccount($username);
-
-// $actor->setTopLevel(true);
+ $actor->setDisplayW3ContextSecurity(true);
return $this->directSuccess($actor);
} catch (Exception $e) {
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);
}