[ADD/WIP] Bridge media Matrix->XMPP

We're on that Reverse Ideology phase.
This commit is contained in:
LDA 2024-06-27 20:09:52 +02:00
commit fbf169a080
9 changed files with 118 additions and 6 deletions

View file

@ -8,7 +8,7 @@
#include <XML.h>
void
XMPPSendPlain(XMPPComponent *comp, char *fr, char *to, char *msg, char *type, char *rst, char *rse, char *event_id)
XMPPSendPlain(XMPPComponent *comp, char *fr, char *to, char *msg, char *type, char *rst, char *rse, char *event_id, char *oob)
{
XMLElement *message, *body, *data, *parsee;
char *from;
@ -25,7 +25,7 @@ XMPPSendPlain(XMPPComponent *comp, char *fr, char *to, char *msg, char *type, ch
XMLAddAttr(message, "type", type);
body = XMLCreateTag("body");
data = XMLCreateText(msg);
data = XMLCreateText(oob ? oob : msg);
/* TODO: Add Parsee specific fields here */
parsee = XMLCreateTag("x-parsee");
@ -65,6 +65,18 @@ XMPPSendPlain(XMPPComponent *comp, char *fr, char *to, char *msg, char *type, ch
/* TODO: Add custom fields depending on the caller's wishes */
}
if (oob)
{
XMLElement *xoob, *oob_data, *oob_url;
xoob = XMLCreateTag("x");
XMLAddAttr(xoob, "xmlns", "jabber:x:oob");
oob_url = XMLCreateTag("url");
oob_data = XMLCreateText(oob);
XMLAddChild(oob_url, oob_data);
XMLAddChild(xoob, oob_url);
XMLAddChild(message, xoob);
}
if (rst && rse)
{
int off = ParseeFindDatastart(msg);