kopia lustrzana https://github.com/nextcloud/social
Make public pages use the proper navigation endpoint
Signed-off-by: Julius Härtl <jus@bitgrid.net>pull/52/head
rodzic
8343cff4c4
commit
f3a36449e0
|
@ -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"') {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
|
Ładowanie…
Reference in New Issue