[ADD] Add basic Matrix ID parser

This commit is contained in:
LDA 2024-08-22 00:04:50 +02:00
commit 8042ccc0cc
8 changed files with 70 additions and 15 deletions

View file

@ -11,6 +11,8 @@
#include <Matrix.h>
#include <AS.h>
#include <ctype.h>
static void
JoinMUC(ParseeData *data, HashMap *event, char *jid, char *muc, char *name)
{
@ -20,7 +22,7 @@ JoinMUC(ParseeData *data, HashMap *event, char *jid, char *muc, char *name)
char *rev = StrConcat(3, muc, "/", nick);
int nonce = 0;
while (!XMPPJoinMUC(data->jabber, jid, rev, true) && nonce < 20)
while (!XMPPJoinMUC(data->jabber, jid, rev, true) && nonce < 32)
{
char *nonce_str = StrInt(nonce);
char *input = StrConcat(4, sender, name, data->id, nonce_str);
@ -122,10 +124,6 @@ ParseeMemberHandler(ParseeData *data, HashMap *event)
goto end;
}
/* TODO: We need to deal with the nick properly, as XMPP
* requires us to provide it whenever we want to even think
* about leaving...
* I love how this is the last place victim of the dreaded [p]... */
name = StrDuplicate(ParseeLookupNick(muc_id, sender));
rev = StrConcat(3, muc_id, "/", name);