use uncensor_pl and fix some report generation logic thresholds

This commit is contained in:
William Kray
2026-02-24 21:47:58 -08:00
parent 08aad9b0e1
commit 774c1e67ed
+12 -4
View File
@@ -437,8 +437,8 @@ class CommunityBot(Plugin):
warn_days_ago = now - (1000 * 60 * 60 * 24 * self.config["warn_threshold_days"]) 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"]) kick_days_ago = now - (1000 * 60 * 60 * 24 * self.config["kick_threshold_days"])
warn_q = """ warn_q = """
SELECT mxid FROM user_events WHERE last_message_timestamp <= $1 AND SELECT mxid FROM user_events WHERE last_message_timestamp < $1 AND
last_message_timestamp >= $2 last_message_timestamp > $2
AND (ignore_inactivity < 1 OR ignore_inactivity IS NULL) AND (ignore_inactivity < 1 OR ignore_inactivity IS NULL)
""" """
kick_q = """ kick_q = """
@@ -1226,7 +1226,11 @@ class CommunityBot(Plugin):
if self.flag_message(evt): if self.flag_message(evt):
# do we need to redact? # do we need to redact?
if ( 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 evt.sender != self.client.mxid
and self.censor_room(evt) and self.censor_room(evt)
): ):
@@ -1244,7 +1248,11 @@ class CommunityBot(Plugin):
if self.flag_instaban(evt): if self.flag_instaban(evt):
# do we need to redact? # do we need to redact?
if ( 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 evt.sender != self.client.mxid
and self.censor_room(evt) and self.censor_room(evt)
): ):