[ADD/WIP] Start making a simple SAX parser, ASwerk

This commit is contained in:
LDA 2024-06-15 12:29:34 +02:00
commit 79217d3608
14 changed files with 1066 additions and 26 deletions

32
src/ParseeUser.c Normal file
View file

@ -0,0 +1,32 @@
#include <Parsee.h>
#include <string.h>
bool
ParseeIsPuppet(const ParseeConfig *conf, char *user)
{
char *localpart;
bool flag = true;
size_t len;
if (!user || !conf || *user != '@')
{
return false;
}
localpart = user + 1;
len = strlen(conf->namespace_base);
if (strncmp(localpart, conf->namespace_base, len))
{
flag = false;
}
len = strlen(conf->sender_localpart);
if (!strncmp(localpart, conf->sender_localpart, len))
{
flag = true;
}
/* TODO: Check serverpart. 2 Parsee instances may be running in the same
* room. */
return flag;
}