[MOD] Mess a bit with rich replies, add XEPS-TBD

This should be a nice list of future XEPs to be implemented, so that I
can keep track of these without having to keep all of these in my head.
This commit is contained in:
LDA 2024-06-25 22:49:33 +02:00
commit 628a55fbca
6 changed files with 127 additions and 18 deletions

View file

@ -289,6 +289,37 @@ ASSetName(const ParseeConfig *conf, char *user, char *name)
JsonFree(json);
Free(user);
}
HashMap *
ASFind(const ParseeConfig *c, char *room, char *event)
{
HttpClientContext *ctx = NULL;
HashMap *json;
char *path, *user;
if (!c || !room || !event)
{
return NULL;
}
user = StrConcat(4, "@", c->sender_localpart, ":", c->homeserver_host);
path = StrConcat(7,
"/_matrix/client/v3/rooms/",
room, "/event/", event, "?",
"user_id=", user
);
ctx = ParseeCreateRequest(c, HTTP_GET, path);
Free(path);
ASAuthenticateRequest(c, ctx);
HttpRequestSendHeaders(ctx);
HttpRequestSend(ctx);
json = JsonDecode(HttpClientStream(ctx));
HttpClientContextFree(ctx);
Free(user);
return json;
}
char *
ASGetName(const ParseeConfig *c, char *room, char *user)
{