]> git.mxchange.org Git - friendica.git/blob - src/Module/Following.php
Merge pull request #7828 from nupplaphil/task/move_enotify
[friendica.git] / src / Module / Following.php
1 <?php
2 /**
3  * @file src/Module/Following.php
4  */
5 namespace Friendica\Module;
6
7 use Friendica\BaseModule;
8 use Friendica\Core\System;
9 use Friendica\Model\User;
10 use Friendica\Protocol\ActivityPub;
11
12 /**
13  * ActivityPub Following
14  */
15 class Following extends BaseModule
16 {
17         public static function rawContent(array $parameters = [])
18         {
19                 $a = self::getApp();
20
21                 // @TODO: Replace with parameter from router
22                 if (empty($a->argv[1])) {
23                         throw new \Friendica\Network\HTTPException\NotFoundException();
24                 }
25
26                 // @TODO: Replace with parameter from router
27                 $owner = User::getOwnerDataByNick($a->argv[1]);
28                 if (empty($owner)) {
29                         throw new \Friendica\Network\HTTPException\NotFoundException();
30                 }
31
32                 $page = $_REQUEST['page'] ?? null;
33
34                 $Following = ActivityPub\Transmitter::getFollowing($owner, $page);
35
36                 header('Content-Type: application/activity+json');
37                 echo json_encode($Following);
38                 exit();
39         }
40 }