mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-14 00:25:11 +00:00
[ADD/WIP] Start receiptwerk
This commit is contained in:
parent
bb836789b2
commit
0fc0fdd6f4
9 changed files with 144 additions and 8 deletions
32
src/AS.c
32
src/AS.c
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue