Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
remove unused room_version_to_event_format (#6857)
Browse files Browse the repository at this point in the history
* commit 'f4884444c':
  remove unused room_version_to_event_format (#6857)
  • Loading branch information
anoadragon453 committed Mar 23, 2020
2 parents 0402b65 + f488444 commit 6e8ecf9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
1 change: 1 addition & 0 deletions changelog.d/6857.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Refactoring work in preparation for changing the event redaction algorithm.
24 changes: 1 addition & 23 deletions synapse/events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@

from unpaddedbase64 import encode_base64

from synapse.api.errors import UnsupportedRoomVersionError
from synapse.api.room_versions import KNOWN_ROOM_VERSIONS, EventFormatVersions
from synapse.api.room_versions import EventFormatVersions
from synapse.types import JsonDict
from synapse.util.caches import intern_dict
from synapse.util.frozenutils import freeze
Expand Down Expand Up @@ -408,27 +407,6 @@ def event_id(self):
return self._event_id


def room_version_to_event_format(room_version):
"""Converts a room version string to the event format
Args:
room_version (str)
Returns:
int
Raises:
UnsupportedRoomVersionError if the room version is unknown
"""
v = KNOWN_ROOM_VERSIONS.get(room_version)

if not v:
# this can happen if support is withdrawn for a room version
raise UnsupportedRoomVersionError()

return v.event_format


def event_type_from_format_version(format_version):
"""Returns the python type to use to construct an Event object for the
given event format version.
Expand Down

0 comments on commit 6e8ecf9

Please sign in to comment.