[MOD] One-way Matrix->XMPP comms.

This is not sanitised. I need to make an XML writer.
This commit is contained in:
LDA 2024-06-17 18:26:37 +02:00
commit bdb4fd2f68
17 changed files with 421 additions and 61 deletions

View file

@ -3,17 +3,26 @@
#include <Cytoplasm/Stream.h>
typedef struct XMPPComponent {
char *host;
Stream *stream;
} XMPPComponent;
/* Initialises a raw component stream to host, with an optional port.
* If said port is 0, then it is set to the default Prosody port */
extern Stream * XMPPInitialiseCompStream(char *host, int port);
extern XMPPComponent * XMPPInitialiseCompStream(char *host, int port);
/* Authenticates a component stream with a given shared secret,
* with a stream ID from the server. This should be called right
* after XMPPInitialiseCompStream. */
extern bool XMPPAuthenticateCompStream(Stream *stream, char *as, char *shared);
extern bool XMPPAuthenticateCompStream(XMPPComponent *comp, char *shared);
/* Sends a presence to a user */
extern void XMPPSendPresence(XMPPComponent *comp, char *fr, char *to);
/* TODO: XMPP stuff, I don't fucking know, I'm not a Jabbernerd. */
extern void XMPPSendPlain(XMPPComponent *c, char *f, char *t, char *m, char *type);
/* Closes a raw component stream. */
extern void XMPPEndCompStream(Stream *stream);
extern void XMPPEndCompStream(XMPPComponent *stream);
#endif