Slon/Api/V1/Announcements: Implement Announcements

Fixes #9
This commit is contained in:
Alec Murphy 2025-03-12 16:19:00 -04:00
parent 6e9f86b4ae
commit 475e648feb
11 changed files with 345 additions and 0 deletions

View file

@ -133,6 +133,20 @@ JsonObject* @slon_api_account_by_remote_actor(U8* remote_actor)
return NULL;
}
JsonObject* @slon_api_announcement_by_id(U8* id)
{
if (!id || !StrLen(id))
return NULL;
JsonArray* announcements = db->a("announcements");
I64 i;
for (i = 0; i < announcements->length; i++) {
if (!StrICmp(announcements->o(i)->@("id"), id)) {
return announcements->o(i);
}
}
return NULL;
}
U0 @slon_api_async_upload_to_catbox(SlonCatboxUpload* cb)
{
if (!cb) {