[MOD] Basic work to get XMPP avatars through PEP

Attaboy!
This commit is contained in:
LDA 2024-09-19 23:24:46 +02:00
commit e54332e376
13 changed files with 428 additions and 25 deletions

View file

@ -141,6 +141,14 @@ extern void ASSetStatus(const ParseeConfig *c, char *user, UserStatus status, ch
* Modifies: NOTHING */
extern char * ASGetName(const ParseeConfig *c, char *room, char *user);
/** Returns the user's avatar in a room, or a the global user avatar, to be
* Free'd
* -------------
* Returns: The user's name in the [HEAP] | NULL
* Thrasher: Free
* Modifies: NOTHING */
extern char * ASGetAvatar(const ParseeConfig *c, char *room, char *user);
/** Uploads data to Matrix to be used later
* ----------------
* Returns: A valid MXC URI[HEAP] | NULL
@ -170,4 +178,16 @@ extern Array * ASGetRelations(const ParseeConfig *c, size_t n, char *room, char
* Thrashes: {relations}
* See-Also: ASGetRelations */
extern void ASFreeRelations(Array *relations);
/** Returns the MIME and SHA-1 hash of a media entry, in one fell swoop.
* -----------------
* Returns: whenever the media exists
* Modifies: {mime}[HEAP], {sha}[HEAP] */
extern bool ASGetMIMESHA(const ParseeConfig *c, char *mxc, char **mime, char **sha);
/** Retrieves media off an MXC link.
* ------------
* Returns: whenever the media exists
* Modifies {mime}[HEAP], {out}[HEAP], {len} */
extern bool ASGrab(const ParseeConfig *c, char *mxc, char **mime, char **out, size_t *len);
#endif

View file

@ -401,4 +401,10 @@ extern void ParseeSetThreads(int xmpp, int http);
extern char * ParseeHMAC(char *key, uint8_t *msg, size_t msglen);
#define ParseeHMACS(key, msg) ParseeHMAC(key, (uint8_t *) msg, strlen(msg))
/** Broadcasts a stanza from a user to any that may be interested by it
* (PEP or subscription)
* -------------------------------------
* Returns: NOTHING */
extern void ParseeBroadcastStanza(ParseeData *data, char *from, XMLElement *s);
#endif