[ADD] Optionally allow instance admins to ignore m.notice events

This commit is contained in:
LDA 2025-04-13 10:39:15 +00:00
commit 7b8ed08e88
5 changed files with 14 additions and 1 deletions

View file

@ -23,6 +23,8 @@ TBD
- The endpoint for media has been changed to '/media/[SERV]/[ID]?hmac=...'
- Add parsee-plumb tool to manage plumbing from outside Parsee if it is not running.
- Add packaging for Guix (see #18)
- Parsee is now dependent on authenticated media to function.
(Please, Matrix, do _not_ touch anything, I do _not_ want to mess with this anymore)
#### Bugfixes
- Fix potential infinite loops when processing some messages.
- Parsee now handles pinging puppets from Matrix more sanely.

View file

@ -22,7 +22,7 @@ Please scream at me if that fails(or just doesn't run on a overclocked Raspberry
### "Why not just use Matrix lol"
### "Why not just use XMPP lol"
These two having the same answer should be enough information. Also can I *just* have fun?
These two having the same answer should be enough information.
One could also argue that both sides need to migrate(onboard) the other side, so
a bridge may be a good way to start.

View file

@ -367,6 +367,7 @@ ParseeMessageHandler(ParseeData *data, HashMap *event)
DbRef *ref = NULL;
HashMap *json = NULL;
char *msgtype = GrabString(event, 2, "content", "msgtype");
char *m_sender = GrabString(event, 1, "sender");
char *unedited_id = NULL;
char *body = GrabString(event, 2, "content", "body");
@ -391,6 +392,13 @@ ParseeMessageHandler(ParseeData *data, HashMap *event)
if (new_content) body = new_content;
}
if (data->config->ignore_bots && StrEquals(msgtype, "m.notice"))
{
Free(reply_id);
Free(xepd);
Free(unedited_id);
return;
}
if (ParseeIsPuppet(data->config, m_sender) ||
ParseeManageBan(data, m_sender, id))
{

View file

@ -85,6 +85,8 @@ ParseeConfigLoad(char *conf)
config->max_stanza_size = 10000;
}
CopyToBool(ignore_bots, "ignore_bots");
CopyToStr(media_base, "media_base");
CopyToStr(db_path, "db");

View file

@ -44,6 +44,7 @@ typedef struct ParseeConfig {
int homeserver_tls;
bool accept_pings;
bool ignore_bots;
/* ------- JABBER -------- */