more nomadic work

This commit is contained in:
Mike Macgirvin 2024-06-26 08:54:20 +10:00
parent b1d794df58
commit 968fc77ba6
4 changed files with 12 additions and 4 deletions

View file

@ -1652,7 +1652,7 @@ class Activity
/** /**
* @throws UnhandledElementException * @throws UnhandledElementException
*/ */
public static function actorEncode($p, $extended = true, $activitypub = false, $export = false) public static function actorEncode($p, $extended = true, $activitypub = false, $export = false, $legacy = false)
{ {
$actor = new Actor(); $actor = new Actor();
$currhub = false; $currhub = false;
@ -1663,6 +1663,9 @@ class Activity
if ($channel) { if ($channel) {
$nomadic = (int)PConfig::Get($channel['channel_id'], 'system', 'nomadicAP'); $nomadic = (int)PConfig::Get($channel['channel_id'], 'system', 'nomadicAP');
if ($legacy) {
$nomadic = false;
}
if ($nomadic && !$extended) { if ($nomadic && !$extended) {
return Channel::getDidResolver($channel, true); return Channel::getDidResolver($channel, true);
} }

View file

@ -66,7 +66,7 @@ class Apgateway extends Controller
// recursively call the router. // recursively call the router.
App::$module_loaded = false; App::$module_loaded = false;
$router = new Router(); $router = new Router();
$router->Dispatch(); $router->Dispatch(true);
} }

View file

@ -42,6 +42,7 @@ class Channel extends Controller
public $profile_uid = 0; public $profile_uid = 0;
public $loading = 0; public $loading = 0;
public $updating = 0; public $updating = 0;
public $legacy = true;
public function init() public function init()
@ -154,7 +155,7 @@ class Channel extends Controller
} }
} }
as_return_and_die(Activity::actorEncode($channel, true, true), $channel); as_return_and_die(Activity::actorEncode($channel, extended: true, activitypub: true, legacy: $this->legacy), $channel);
} }
// handle zot6 channel discovery // handle zot6 channel discovery

View file

@ -179,9 +179,13 @@ class Router
* @brief * @brief
* *
*/ */
public function Dispatch() public function Dispatch($setLegacy = false)
{ {
if ($setLegacy && isset($this->controller->legacy)) {
$this->controller->legacy = false;
}
/** /**
* Call module functions * Call module functions
*/ */