Commit db65fd22 authored by David Libeau's avatar David Libeau

Add following, followers and outbox endpoints

parent f2ced242
......@@ -51,6 +51,10 @@ class User{
public function viewActivityJson($id) {
global $core;
$this->init($id);
/*
viewActivityJson : view object in Activity Pub json format
@param: $id
*/
$activityjson=array(
"@context" => array(
......@@ -79,6 +83,62 @@ class User{
);
View::render("json",$activityjson);
}
public function viewFollowing($id){
global $core;
$this->init($id);
/*
viewFollowing : view following in Activity Pub json format
@param: $id
*/
$activityjson=array(
"@context" => array(
"https://www.w3.org/ns/activitystreams",
),
"id" => "https://".$core->get("domain")."/account/".$this->id,
"type" => "OrderedCollection",
"totalItems" => 0,
);
View::render("json",$activityjson);
}
public function viewFollowers($id){
global $core;
$this->init($id);
/*
viewFollowers : view followers in Activity Pub json format
@param: $id
*/
$activityjson=array(
"@context" => array(
"https://www.w3.org/ns/activitystreams",
),
"id" => "https://".$core->get("domain")."/account/".$this->id,
"type" => "OrderedCollection",
"totalItems" => 0,
);
View::render("json",$activityjson);
}
public function viewOutbox($id){
global $core;
$this->init($id);
/*
viewFollowers : view outbox in Activity Pub json format
@param: $id
*/
$activityjson=array(
"@context" => array(
"https://www.w3.org/ns/activitystreams",
),
"id" => "https://".$core->get("domain")."/account/".$this->id,
"type" => "OrderedCollection",
"totalItems" => 0,
);
View::render("json",$activityjson);
}
public function dump($id) {
$this->init($id);
View::render("dump",$this);
......
......@@ -53,7 +53,7 @@
</route>
</route>
<route>
<content>account(s)?</content>
<content>account(s)?|user(s)?</content>
<return method="get">
<function>User->viewAll</function>
</return>
......@@ -113,9 +113,9 @@
</return>
</route>
<route>
<content>follows</content>
<content>following</content>
<return method="get">
<function>User->viewFollows</function>
<function>User->viewFollowing</function>
<params>:parent</params>
</return>
</route>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment