[FIX/MOD] Stanza send function, fix some errors

Negociating stanza sizes seems to be real trouble. Also this code is now
`-fanalyzer'-safe!
Also kills the last GNUMakefile present. It wasn't even used...
This commit is contained in:
LDA 2024-10-19 16:58:48 +02:00
commit ff5f085b7f
24 changed files with 114 additions and 152 deletions

View file

@ -45,6 +45,7 @@ typedef struct ParseeConfig {
char *component_host;
char *shared_comp_secret;
int component_port;
size_t max_stanza_size;
/* ------- DB -------- */
char *db_path;
@ -80,6 +81,7 @@ typedef struct Argument {
const char *description;
} Argument;
/* A few helpful macros to make JSON less of a PITA */
#define GrabString(obj, ...) JsonValueAsString(JsonGet(obj, __VA_ARGS__))
#define GrabInteger(obj, ...) JsonValueAsInteger(JsonGet(obj, __VA_ARGS__))
#define GrabBoolean(obj, ...) JsonValueAsBoolean(JsonGet(obj, __VA_ARGS__))
@ -114,6 +116,9 @@ extern void ParseePrintASCII(void);
/**
* Checks if two versions of Parsee can be considered "compatible".
* This is mainly used for things like database operations. TODO:
* Make an auto-upgrade system to comply with the (undocumented)
* rule of "Don't Make The Sysadmin Think About Parsee Too Much".
* ---------------
* Modifies: NOTHING */
extern bool ParseeIsCompatible(char *ver1, char *ver2);

View file

@ -4,7 +4,7 @@
#include <Cytoplasm/Stream.h>
/* Creates a string stream writer. The referenced buffer must be in the heap,
* or NULL. */
* or NULL for an empty string. */
extern Stream * StrStreamWriter(char **buffer);
/* Creates a string stream reader. The referenced buffer may be everywhere. */

View file

@ -29,6 +29,13 @@ extern XMPPComponent * XMPPInitialiseCompStream(char *host, int port);
* after XMPPInitialiseCompStream. */
extern bool XMPPAuthenticateCompStream(XMPPComponent *comp, char *shared);
/** Writes an XML stanza through a component, while making sure any locking
* work is done.
* -----------------------
* Modifies: {comp}, the XMPP stream
* See-Also: XMPPInitialiseCompStream, XMPPAuthenticateCompStream, XMPP-core RFC */
extern void XMPPSendStanza(XMPPComponent *comp, XMLElement *stanza);
/* Makes a user join/leave a MUC */
extern bool XMPPJoinMUC(XMPPComponent *comp, char *fr, char *muc, char *hash, int secs, bool ret);
extern void XMPPLeaveMUC(XMPPComponent *comp, char *fr, char *muc, char *r);