kopia lustrzana https://github.com/nextcloud/social
add w3 @context in actor
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>pull/335/head
rodzic
6ad5dcfd12
commit
5890714307
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
@ -171,6 +173,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
|
||||
*/
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue