[MOD] Carve the way to XMPP rich replies

Bifrost could *never*!
This commit is contained in:
LDA 2024-06-23 23:46:46 +02:00
commit fe77906cde
10 changed files with 126 additions and 18 deletions

View file

@ -169,16 +169,17 @@ ASSetState(const ParseeConfig *conf, char *id, char *type, char *key, char *mask
HttpClientContextFree(ctx);
JsonFree(state);
}
void
char *
ASSend(const ParseeConfig *conf, char *id, char *user, char *type, HashMap *c)
{
HttpClientContext *ctx = NULL;
char *path, *params;
char *txn;
char *txn, *ret;
HashMap *reply;
if (!conf || !id || !type || !user || !c)
{
JsonFree(c);
return;
return NULL;
}
txn = StrRandom(16);
@ -193,9 +194,15 @@ ASSend(const ParseeConfig *conf, char *id, char *user, char *type, HashMap *c)
Free(path);
ASAuthenticateRequest(conf, ctx);
ParseeSetRequestJSON(ctx, c);
reply = JsonDecode(HttpClientStream(ctx));
ret = StrDuplicate(JsonValueAsString(HashMapGet(reply, "event_id")));
JsonFree(reply);
HttpClientContextFree(ctx);
JsonFree(c);
return ret;
}
char *
ASCreateRoom(const ParseeConfig *conf, char *by, char *alias)