From 774c1e67ed457bc0d130c9a23f8f9112d0e0245a Mon Sep 17 00:00:00 2001 From: William Kray Date: Tue, 24 Feb 2026 21:47:58 -0800 Subject: [PATCH] use uncensor_pl and fix some report generation logic thresholds --- community/bot.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/community/bot.py b/community/bot.py index 475e463..8ce72ab 100644 --- a/community/bot.py +++ b/community/bot.py @@ -437,8 +437,8 @@ class CommunityBot(Plugin): warn_days_ago = now - (1000 * 60 * 60 * 24 * self.config["warn_threshold_days"]) kick_days_ago = now - (1000 * 60 * 60 * 24 * self.config["kick_threshold_days"]) warn_q = """ - SELECT mxid FROM user_events WHERE last_message_timestamp <= $1 AND - last_message_timestamp >= $2 + SELECT mxid FROM user_events WHERE last_message_timestamp < $1 AND + last_message_timestamp > $2 AND (ignore_inactivity < 1 OR ignore_inactivity IS NULL) """ kick_q = """ @@ -1226,7 +1226,11 @@ class CommunityBot(Plugin): if self.flag_message(evt): # do we need to redact? if ( - not await self.user_permitted(evt.sender) + not await self.user_permitted( + evt.sender, + self.config["uncensor_pl"], + evt.room_id, + ) and evt.sender != self.client.mxid and self.censor_room(evt) ): @@ -1244,7 +1248,11 @@ class CommunityBot(Plugin): if self.flag_instaban(evt): # do we need to redact? if ( - not await self.user_permitted(evt.sender) + not await self.user_permitted( + evt.sender, + self.config["uncensor_pl"], + evt.room_id, + ) and evt.sender != self.client.mxid and self.censor_room(evt) ):