Revert "Allow room moderators to view redacted event content"

This reverts commit 2dc2979af5.

The feature was merged to upstream, and merging upstream will be cleaner
without this commit here.
This commit is contained in:
Tulir Asokan 2022-04-26 14:40:17 +03:00
parent ff7bece06f
commit 90c00fb04b
4 changed files with 3 additions and 84 deletions

View file

@ -79,8 +79,6 @@ class Codes:
UNABLE_AUTHORISE_JOIN = "M_UNABLE_TO_AUTHORISE_JOIN"
UNABLE_TO_GRANT_JOIN = "M_UNABLE_TO_GRANT_JOIN"
UNREDACTED_CONTENT_DELETED = "FI.MAU.MSC2815_UNREDACTED_CONTENT_DELETED"
class CodeMessageException(RuntimeError):
"""An exception with integer code and message string attributes.
@ -485,22 +483,6 @@ class RequestSendFailed(RuntimeError):
self.can_retry = can_retry
class UnredactedContentDeleted(SynapseError):
def __init__(self, content_keep_ms: Optional[int] = None):
super().__init__(
404,
"The content for that event has already been erased from the database",
errcode=Codes.UNREDACTED_CONTENT_DELETED,
)
self.content_keep_ms = content_keep_ms
def error_dict(self) -> "JsonDict":
extra = {}
if self.content_keep_ms is not None:
extra = {"fi.mau.msc2815.content_keep_ms": self.content_keep_ms}
return cs_error(self.msg, self.errcode, **extra)
def cs_error(msg: str, code: str = Codes.UNKNOWN, **kwargs: Any) -> "JsonDict":
"""Utility method for constructing an error response for client-server
interactions.