Add FetchNote method to ActivityPubService

This commit is contained in:
Laura Hausmann 2024-01-20 22:34:50 +01:00
parent 8dc044d428
commit 6351afb39c
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -28,4 +28,9 @@ public class ActivityPubService(HttpClient client, HttpRequestService httpRqSvc)
var activity = await FetchActivity(uri);
return activity.OfType<ASActor>().FirstOrDefault() ?? throw new Exception("Failed to fetch actor");
}
public async Task<ASNote> FetchNote(string uri) {
var activity = await FetchActivity(uri);
return activity.OfType<ASNote>().FirstOrDefault() ?? throw new Exception("Failed to fetch note");
}
}