[MOD/WIP] Kill off the stanza sending function

The stanza sender is dead. All hail the Stanza Builder.
This commit is contained in:
LDA 2024-08-13 20:24:32 +02:00
commit ffc0679493
8 changed files with 379 additions and 184 deletions

View file

@ -7,6 +7,7 @@
#include <string.h>
#include <stdlib.h>
#include <StanzaBuilder.h>
#include <Matrix.h>
#include <AS.h>
@ -229,6 +230,7 @@ static void
ParseeMessageHandler(ParseeData *data, HashMap *event)
{
XMPPComponent *jabber = data->jabber;
StanzaBuilder *builder;
DbRef *ref = NULL;
HashMap *json;
@ -338,12 +340,16 @@ ParseeMessageHandler(ParseeData *data, HashMap *event)
}
{
char *xmpp_ident = StrRandom(32);
XMPPSendPlainID(
jabber, xmppified_user, to,
xepd ? xepd : body, type,
stanza, sender, ev_id, unauth, origin_id,
xmpp_ident
);
builder = CreateStanzaBuilder(xmppified_user, to, xmpp_ident);
SetStanzaType(builder, type);
SetStanzaBody(builder, xepd ? xepd : body);
SetStanzaReply(builder, stanza, sender);
SetStanzaLink(builder, unauth);
SetStanzaEdit(builder, origin_id);
SetStanzaXParsee(builder, event);
WriteoutStanza(builder, jabber);
DestroyStanzaBuilder(builder);
if (direct)
{