Skip to content

Commit 478577e

Browse files
authored
Allow raw dicts in MemoryStateStore.set_power_levels (#127)
1 parent fba7541 commit 478577e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mautrix/client/state_store/memory.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,10 @@ async def get_power_levels(self, room_id: RoomID) -> PowerLevelStateEventContent
170170
return self.power_levels.get(room_id)
171171

172172
async def set_power_levels(
173-
self, room_id: RoomID, content: PowerLevelStateEventContent
173+
self, room_id: RoomID, content: PowerLevelStateEventContent | dict[str, Any]
174174
) -> None:
175+
if not isinstance(content, PowerLevelStateEventContent):
176+
content = PowerLevelStateEventContent.deserialize(content)
175177
self.power_levels[room_id] = content
176178

177179
async def has_encryption_info_cached(self, room_id: RoomID) -> bool:

0 commit comments

Comments
 (0)