mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 22:55:11 +00:00
[MOD] Carve the way to XMPP rich replies
Bifrost could *never*!
This commit is contained in:
parent
10e140e2a2
commit
fe77906cde
10 changed files with 126 additions and 18 deletions
13
src/AS.c
13
src/AS.c
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue