mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 21:25:11 +00:00
[ADD/WIP] Start making a simple SAX parser, ASwerk
This commit is contained in:
parent
0fa95c2d14
commit
79217d3608
14 changed files with 1066 additions and 26 deletions
32
src/ParseeUser.c
Normal file
32
src/ParseeUser.c
Normal 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue