Ignore redactions of m.room.create events (#5701)

This commit is contained in:
Richard van der Hoff 2019-07-17 19:08:02 +01:00 committed by GitHub
parent 1def298119
commit 9c70a02a9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 57 additions and 24 deletions

View file

@ -259,6 +259,14 @@ class EventsWorkerStore(SQLBaseStore):
continue
original_event = original_event_entry.event
if original_event.type == EventTypes.Create:
# we never serve redactions of Creates to clients.
logger.info(
"Withholding redaction %s of create event %s",
event_id,
redacted_event_id,
)
continue
if entry.event.internal_metadata.need_to_check_redaction():
original_domain = get_domain_from_id(original_event.sender)
@ -617,6 +625,10 @@ class EventsWorkerStore(SQLBaseStore):
Deferred[EventBase|None]: if the event should be redacted, a pruned
event object. Otherwise, None.
"""
if original_ev.type == "m.room.create":
# we choose to ignore redactions of m.room.create events.
return None
redaction_map = yield self._get_events_from_cache_or_db(redactions)
for redaction_id in redactions: