Skip to content

Commit

Permalink
Ignore and log error when trying to change the PLs
Browse files Browse the repository at this point in the history
  • Loading branch information
MatMaul committed May 24, 2024
1 parent ad4eef0 commit e8c00a0
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions room_access_rules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def get_room_ids_from(
room_ids = await self.module_api.run_db_interaction(
"get_room_ids_from",
get_room_ids_from,
limit=100,
limit=50,
from_id=last_room_id,
)

Expand Down Expand Up @@ -260,15 +260,21 @@ async def fix_room_power_levels(self, room_id: str) -> None:
# Send the updated pl event to the room with a local admin
if changed:
logger.info(f"Fixing power levels of room {room_id}")
await self.module_api.create_and_send_event_into_room(
{
"room_id": room_id,
"type": "m.room.power_levels",
"state_key": "",
"sender": admin_user,
"content": content,
}
)
try:
await self.module_api.create_and_send_event_into_room(
{
"room_id": room_id,
"type": "m.room.power_levels",
"state_key": "",
"sender": admin_user,
"content": content,
}
)
except SynapseError as e:
logger.info(
f"Not possible to change power levels of room {room_id}, {str(e)}"
)
logger.debug(content)

async def on_create_room(
self,
Expand Down

0 comments on commit e8c00a0

Please sign in to comment.