Allow room moderators to view redacted event content

Cherry-picked from ffcdac4f348ef763843017f7cc46ed63e9285183
This commit is contained in:
Tulir Asokan 2022-04-08 23:39:01 +03:00
parent 703eb4dc19
commit 2dc2979af5
4 changed files with 84 additions and 3 deletions

View file

@ -304,6 +304,15 @@ class EventsWorkerStore(SQLBaseStore):
desc="get_received_ts",
)
async def have_censored_event(self, event_id: str) -> Optional[bool]:
return await self.db_pool.simple_select_one_onecol(
table="redactions",
keyvalues={"redacts": event_id},
retcol="have_censored",
desc="get_have_censored",
allow_none=True,
)
# Inform mypy that if allow_none is False (the default) then get_event
# always returns an EventBase.
@overload