Rename the EventFormatVersions enum values so that they line up with room version numbers. (#13706)

This commit is contained in:
reivilibre 2022-09-07 10:08:20 +00:00 committed by GitHub
parent bb5b47b62a
commit c2fe48a6ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 47 additions and 41 deletions

View file

@ -821,7 +821,7 @@ def _alias_event(room_version: RoomVersion, sender: str, **kwargs) -> EventBase:
def _build_auth_dict_for_room_version(
room_version: RoomVersion, auth_events: Iterable[EventBase]
) -> List:
if room_version.event_format == EventFormatVersions.V1:
if room_version.event_format == EventFormatVersions.ROOM_V1_V2:
return [(e.event_id, "not_used") for e in auth_events]
else:
return [e.event_id for e in auth_events]
@ -871,7 +871,7 @@ event_count = 0
def _maybe_get_event_id_dict_for_room_version(room_version: RoomVersion) -> dict:
"""If this room version needs it, generate an event id"""
if room_version.event_format != EventFormatVersions.V1:
if room_version.event_format != EventFormatVersions.ROOM_V1_V2:
return {}
global event_count