[FIX/WIP] Fix replies and try fixing a bug with MUCs

This commit is contained in:
lda 2025-02-15 08:44:25 +00:00
commit e2b014d000
11 changed files with 142 additions and 20 deletions

View file

@ -368,7 +368,7 @@ extern char * ParseeDMEventFromID(ParseeData *d, char *r_id, char *ori_id);
extern char * ParseeDMEventFromSID(ParseeData *d, char *r_id, char *ori_id);
/* Gets a Parsee "shim" link to an MXC, usable as unauth for a limited time */
extern char * ParseeToUnauth(ParseeData *data, char *mxc);
extern char * ParseeToUnauth(ParseeData *data, char *mxc, char *filename);
extern void ParseeInitialiseOIDTable(void);
extern void ParseePushOIDTable(char *muc, char *occupant);

View file

@ -79,7 +79,8 @@ typedef struct ParseeCmdArg {
X_ROUTE("/_matrix/app/v1/users/(.*)", RouteUserAck) \
X_ROUTE("/_matrix/app/v1/rooms/(.*)", RouteRoomAck) \
X_ROUTE("/_matrix/app/v1/ping", RoutePing) \
X_ROUTE("/media/(.*)/(.*)", RouteMedia)
X_ROUTE("/media/(.*)/(.*)", RouteMedia) \
X_ROUTE("/media/(.*)/(.*)/(.*)", RouteMedia)
#define X_ROUTE(path, name) extern void * name(Array *, void *);
ROUTES

View file

@ -82,4 +82,10 @@ extern Unistr * UnistrFilter(Unistr *str, UnistrFilterFunc filter);
* --------
* Returns: an offset of the first line to not start by {c} | 0 */
extern size_t UnistrGetOffset(Unistr *str, uint32_t sep);
/** Locates the new index within a regular UTF-8 sequence from an index
* within all codepoints.
* -----------------------------------
* Returns: an offset */
extern size_t UnistrGetUTFOffset(char *cstr, size_t unicode);
#endif

View file

@ -90,6 +90,9 @@ extern char * XMPPGetRetractedID(XMLElement *);
/* Get the replied-to stanza ID, if existent. */
extern char * XMPPGetReply(XMLElement *elem);
/* Get the replied-to stanza offset, if existent. */
extern ssize_t XMPPGetReplyOffset(XMLElement *elem);
/** Get the moderated message ID(as a stanza ID/plain ID) from a moderation
* stanza, that lives *alongside* the stanza itself.
* ----------------------------------------------------------------------