Slon/Modules/Api: Add @slon_api_account_by_acct()

This commit is contained in:
Alec Murphy 2025-02-17 08:18:16 -05:00
parent f1cb6b1304
commit 89131f2ba8

View file

@ -57,6 +57,20 @@ JsonObject* @slon_api_account_by_email(U8* email)
return NULL;
}
JsonObject* @slon_api_account_by_acct(U8* acct)
{
if (!acct || !StrLen(acct))
return NULL;
JsonArray* accts = db->a("accounts");
I64 i;
for (i = 0; i < accts->length; i++) {
if (!StrICmp(accts->o(i)->@("acct"), acct)) {
return accts->o(i);
}
}
return NULL;
}
JsonObject* @slon_api_account_by_id(U8* id)
{
if (!id || !StrLen(id))