mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 22:45:12 +00:00
[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:
parent
ae740878c8
commit
628a55fbca
6 changed files with 127 additions and 18 deletions
31
src/AS.c
31
src/AS.c
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue