[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

@ -0,0 +1,22 @@
#ifndef PARSEE_STANZABUILDER_H
#define PARSEE_STANZABUILDER_H
#include <XMPP.h>
#include <XML.h>
typedef struct StanzaBuilder StanzaBuilder;
extern StanzaBuilder * CreateStanzaBuilder(char *from, char *to, char *id);
extern StanzaBuilder * SetStanzaType(StanzaBuilder *builder, char *type);
extern StanzaBuilder * SetStanzaBody(StanzaBuilder *builder, char *body);
extern StanzaBuilder * SetStanzaReply(StanzaBuilder *builder, char *st, char *se);
extern StanzaBuilder * SetStanzaEdit(StanzaBuilder *builder, char *to);
extern StanzaBuilder * SetStanzaLink(StanzaBuilder *builder, char *oob);
extern StanzaBuilder * SetStanzaID(StanzaBuilder *builder, char *id);
extern StanzaBuilder * SetStanzaXParsee(StanzaBuilder *builder, HashMap *e);
extern StanzaBuilder * AddStanzaElem(StanzaBuilder *builder, XMLElement *item);
extern XMLElement * ExportStanza(StanzaBuilder *builder);
extern void WriteoutStanza(StanzaBuilder *builder, XMPPComponent *jabber);
extern void DestroyStanzaBuilder(StanzaBuilder *builder);
#endif

View file

@ -34,8 +34,6 @@ extern bool XMPPJoinMUC(XMPPComponent *comp, char *fr, char *muc);
extern void XMPPLeaveMUC(XMPPComponent *comp, char *fr, char *muc, char *r);
/* TODO: XMPP stuff, I don't fucking know, I'm not a Jabbernerd. */
extern void XMPPSendPlain(XMPPComponent *comp, char *fr, char *to, char *msg, char *type, char *rst, char *rse, char *event_id, char *oob, char *id);
extern void XMPPSendPlainID(XMPPComponent *comp, char *fr, char *to, char *msg, char *type, char *rst, char *rse, char *event_id, char *oob, char *id, char *sid);
extern void XMPPRetract(XMPPComponent *comp, char *fr, char *to, char *type, char *redact);
/* Finishes a component stream, and doesn't free it. */