[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

@ -7,7 +7,7 @@
#include <XML.h>
void
XMPPSendPlain(XMPPComponent *comp, char *fr, char *to, char *msg, char *type)
XMPPSendPlain(XMPPComponent *comp, char *fr, char *to, char *msg, char *type, char *rst, char *rse)
{
XMLElement *message, *body, *data, *parsee;
char *from;
@ -50,6 +50,15 @@ XMPPSendPlain(XMPPComponent *comp, char *fr, char *to, char *msg, char *type)
/* TODO: Add custom fields depending on the caller's wishes */
}
if (rst && rse)
{
XMLElement *reply = XMLCreateTag("reply");
XMLAddAttr(reply, "to", rse);
XMLAddAttr(reply, "id", rst);
XMLAddAttr(reply, "xmlns", "urn:xmpp:reply:0");
XMLAddChild(message, reply);
}
XMLAddChild(message, body);
XMLAddChild(message, parsee);
XMLAddChild(body, data);