mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 22:55:11 +00:00
[ADD/WIP] One-way chatstates, capabilities
No avatarwerk today because avatars are an absolute sore.
This commit is contained in:
parent
59d5ad6780
commit
6b0f08c49e
10 changed files with 349 additions and 24 deletions
30
src/AS.c
30
src/AS.c
|
|
@ -602,3 +602,33 @@ ASReupload(const ParseeConfig *c, char *from, char **mime)
|
|||
UriFree(uri);
|
||||
return ret;
|
||||
}
|
||||
void
|
||||
ASType(const ParseeConfig *c, char *user, char *room, bool status)
|
||||
{
|
||||
HttpClientContext *ctx = NULL;
|
||||
HashMap *json;
|
||||
char *path, *full;
|
||||
if (!c || !user || !room)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
user = HttpUrlEncode(user);
|
||||
path = StrConcat(6,
|
||||
"/_matrix/client/v3/rooms/",
|
||||
room, "/typing/", user,
|
||||
"?user_id=", user
|
||||
);
|
||||
|
||||
json = HashMapCreate();
|
||||
HashMapSet(json, "typing", JsonValueBoolean(status));
|
||||
HashMapSet(json, "timeout", JsonValueBoolean(1 MINUTES));
|
||||
ctx = ParseeCreateRequest(c, HTTP_PUT, path);
|
||||
Free(path);
|
||||
ASAuthenticateRequest(c, ctx);
|
||||
ParseeSetRequestJSON(ctx, json);
|
||||
JsonFree(json);
|
||||
|
||||
HttpClientContextFree(ctx);
|
||||
Free(user);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue