AP: move types to their own directory

This commit is contained in:
2024-02-23 13:33:37 -03:00
parent b27e6cb2ec
commit 6f7e223b3d
6 changed files with 165 additions and 141 deletions

View File

@@ -10,8 +10,7 @@ import singletons;
import net.request_pool;
import webfinger;
import ap.errors;
import ap.actor;
import ap.activity_stream;
import ap.types.object;
enum {
ActivityJson = "application/activity+json",
@@ -29,7 +28,7 @@ JSONValue apFetchRemoteUser(JSONValue wf) {
rq.url = wf["href"].str;
rq.headers["Accept"] = wf["type"].str;
Response rs = Rp.request(rq, true);
Response rs = RP.request(rq, true);
return parseJSON(cast(string) rs.responseBody);
}
@@ -44,7 +43,7 @@ ASObject apFetchASObject(string id, string contentType = ActivityJson) {
rq.url = id;
rq.headers["Accept"] = contentType;
Response rs = Rp.request(rq, true);
Response rs = RP.request(rq, true);
return new ASObject(parseJSON(cast(string) rs.responseBody));
}