mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 09:25:11 +00:00
[ADD] Optionally allow instance admins to ignore m.notice events
This commit is contained in:
parent
45250096ad
commit
7b8ed08e88
5 changed files with 14 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ typedef struct ParseeConfig {
|
|||
int homeserver_tls;
|
||||
|
||||
bool accept_pings;
|
||||
bool ignore_bots;
|
||||
|
||||
|
||||
/* ------- JABBER -------- */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue