[ADD/WIP] Continue MUCwerk

oh man this is gonna be painful to do... xmpp is fine iff youre doing
DMs isnt it?
This commit is contained in:
LDA 2024-06-21 00:48:27 +02:00
commit d3b7f2fee0
19 changed files with 707 additions and 44 deletions

View file

@ -19,8 +19,8 @@ extern XMPPComponent * XMPPInitialiseCompStream(char *host, int port);
* after XMPPInitialiseCompStream. */
extern bool XMPPAuthenticateCompStream(XMPPComponent *comp, char *shared);
/* Sends a presence to a user */
extern void XMPPSendPresence(XMPPComponent *comp, char *fr, char *to);
/* Makes a user join a MUC */
extern void XMPPJoinMUC(XMPPComponent *comp, char *fr, char *muc);
/* 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);
@ -30,8 +30,25 @@ extern void XMPPEndCompStream(XMPPComponent *stream);
/* Sends a loopback stanza (a "killstanza"), used to kill an XMPP listener
* thread. */
extern void XMPPKillThread(XMPPComponent *jabber);
extern void XMPPKillThread(XMPPComponent *jabber, char *killer);
/* Checks if a stanza is a "killstanza". */
extern bool XMPPIsKiller(XMLElement *);
typedef struct MUCInfo {
bool exists;
XMPPComponent *jabber;
XMLElement *iq_reply;
} MUCInfo;
/* Queries a MUC's existence, and if $[out] is set, stores information
* pertaining the MUC itself from an <iq> query, to be freed by
* XMPPFreeMUCInfo */
extern bool XMPPQueryMUC(XMPPComponent *jabber, char *muc, MUCInfo *out);
/* Retrieves the MUC's name from an IQ reply */
extern char * XMPPGetMUCName(MUCInfo info);
extern void XMPPFreeMUCInfo(MUCInfo info);
#endif