Skip to content

Commit

Permalink
Fix potential KeyError in power level syncing
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Apr 4, 2020
1 parent 26eb2d4 commit a53b0e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mautrix_telegram/portal/metadata.py
Expand Up @@ -433,7 +433,7 @@ def _participants_to_power_levels(self, participants: List[TypeParticipant],
return False
changed = False
admin_power_level = min(75 if self.peer_type == "channel" else 50, bot_level)
if levels.events[EventType.ROOM_POWER_LEVELS] != admin_power_level:
if levels.get_event_level(EventType.ROOM_POWER_LEVELS) != admin_power_level:
changed = True
levels.events[EventType.ROOM_POWER_LEVELS] = admin_power_level

Expand Down

0 comments on commit a53b0e9

Please sign in to comment.