mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-14 00:45:10 +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
|
|
@ -27,10 +27,10 @@ ParseeWakeupThread(void)
|
|||
static void
|
||||
ParseeDMHandler(char *room, char *from, XMLElement *data, const ParseeConfig *c)
|
||||
{
|
||||
ASSend(
|
||||
Free(ASSend(
|
||||
c, room, from,
|
||||
"m.room.message", MatrixCreateMessage(data->data)
|
||||
);
|
||||
));
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -71,6 +71,7 @@ MessageStanza(ParseeData *args, XMLElement *stanza)
|
|||
char *res = ParseeGetResource(from);
|
||||
char *encoded = ParseeEncodeJID(args->config, from, false);
|
||||
char *s_id_str = HashMapGet(stanza_id->attrs, "id");
|
||||
char *event_id;
|
||||
|
||||
/* TODO: Create smarter puppet names */
|
||||
if (ParseeVerifyStanza(args, chat_id, s_id_str))
|
||||
|
|
@ -93,7 +94,7 @@ MessageStanza(ParseeData *args, XMLElement *stanza)
|
|||
mxc = ASReupload(args->config, oob_data->data, &mime);
|
||||
content = MatrixCreateMedia(mxc, data->data, mime);
|
||||
|
||||
ASSend(
|
||||
event_id = ASSend(
|
||||
args->config, mroom_id, encoded,
|
||||
"m.room.message", content
|
||||
);
|
||||
|
|
@ -102,12 +103,13 @@ MessageStanza(ParseeData *args, XMLElement *stanza)
|
|||
}
|
||||
else
|
||||
{
|
||||
ASSend(
|
||||
event_id = ASSend(
|
||||
args->config, mroom_id, encoded,
|
||||
"m.room.message", MatrixCreateMessage(data->data)
|
||||
);
|
||||
}
|
||||
ParseePushStanza(args, chat_id, s_id_str);
|
||||
ParseePushStanza(args, chat_id, s_id_str, event_id, from);
|
||||
Free(event_id);
|
||||
}
|
||||
|
||||
Free(res);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue