[ADD/WIP] Start receiptwerk

This commit is contained in:
LDA 2024-07-06 00:38:10 +02:00
commit 0fc0fdd6f4
9 changed files with 144 additions and 8 deletions

View file

@ -732,6 +732,38 @@ ASType(const ParseeConfig *c, char *user, char *room, bool status)
Free(user);
}
void
ASPresence(const ParseeConfig *c, char *user, char *room, char *ev)
{
HttpClientContext *ctx = NULL;
HashMap *json;
char *path;
if (!c || !user || !room || !ev)
{
return;
}
user = HttpUrlEncode(user);
room = HttpUrlEncode(room);
ev = HttpUrlEncode(ev);
path = StrConcat(6,
"/_matrix/client/v3/rooms/",
room, "/receipt/m.read/", ev,
"?user_id=", user
);
json = HashMapCreate();
ctx = ParseeCreateRequest(c, HTTP_POST, path);
Free(path);
ASAuthenticateRequest(c, ctx);
ParseeSetRequestJSON(ctx, json);
JsonFree(json);
HttpClientContextFree(ctx);
Free(user);
Free(room);
Free(ev);
}
HashMap *
ASGetUserConfig(const ParseeConfig *c, char *user, char *key)