Make public pages use the proper navigation endpoint

Signed-off-by: Julius Härtl <jus@bitgrid.net>
alpha1
Julius Härtl 2018-11-21 12:45:17 +01:00
rodzic 8343cff4c4
commit f3a36449e0
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4C614C6ED2CDE6DF
3 zmienionych plików z 10 dodań i 5 usunięć

Wyświetl plik

@ -73,6 +73,9 @@ class ActivityPubController extends Controller {
/** @var MiscService */
private $miscService;
/** @var NavigationController */
private $navigationController;
/**
* ActivityPubController constructor.
@ -90,11 +93,13 @@ class ActivityPubController extends Controller {
IRequest $request, SocialPubController $socialPubController,
ActivityService $activityService, ImportService $importService,
FollowService $followService, ActorService $actorService, NotesRequest $notesRequest,
NavigationController $navigationController,
MiscService $miscService
) {
parent::__construct(Application::APP_NAME, $request);
$this->socialPubController = $socialPubController;
$this->navigationController = $navigationController;
$this->activityService = $activityService;
$this->importService = $importService;
@ -122,7 +127,7 @@ class ActivityPubController extends Controller {
*/
public function actor(string $username): Response {
if (!$this->checkSourceActivityStreams()) {
return $this->socialPubController->actor($username);
return $this->navigationController->public();
}
try {
@ -326,7 +331,7 @@ class ActivityPubController extends Controller {
private function checkSourceActivityStreams(): bool {
// uncomment this line to display the result that would be return to an ActivityPub service (TEST)
return true;
// return true;
if ($this->request->getHeader('Accept')
=== 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"') {

Wyświetl plik

@ -95,7 +95,7 @@ class LocalController extends Controller {
* @param MiscService $miscService
*/
public function __construct(
IRequest $request, string $userId, PersonService $personService,
IRequest $request, $userId, PersonService $personService,
FollowService $followService, ActorService $actorService,
PostService $postService, NoteService $noteService,
MiscService $miscService

Wyświetl plik

@ -48,7 +48,7 @@ export default new Router({
name: 'timeline'
},
{
path: '/:index(index.php/)?apps/social/account/:account',
path: '/:index(index.php/)?apps/social/account/@:account',
components: {
default: Profile
},
@ -78,7 +78,7 @@ export default new Router({
]
},
{
path: '/:index(index.php/)?apps/social/:account',
path: '/:index(index.php/)?apps/social/@:account',
component: Profile,
props: true,
name: 'public'