Skip to content
Snippets Groups Projects
Unverified Commit a0ed0f36 authored by Richard van der Hoff's avatar Richard van der Hoff Committed by GitHub
Browse files

Soft-fail spammy events received over federation (#10263)

parent 3d370efc
No related branches found
No related tags found
No related merge requests found
Mark events received over federation which fail a spam check as "soft-failed".
......@@ -89,12 +89,12 @@ class FederationBase:
result = await self.spam_checker.check_event_for_spam(pdu)
if result:
logger.warning(
"Event contains spam, redacting %s: %s",
pdu.event_id,
pdu.get_pdu_json(),
)
return prune_event(pdu)
logger.warning("Event contains spam, soft-failing %s", pdu.event_id)
# we redact (to save disk space) as well as soft-failing (to stop
# using the event in prev_events).
redacted_event = prune_event(pdu)
redacted_event.internal_metadata.soft_failed = True
return redacted_event
return pdu
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment