Handle some weird cases with get_joined_rooms()

This commit is contained in:
Tulir Asokan
2018-02-13 01:10:03 +02:00
parent e4cb2d458d
commit 496ebd2c8d
+5 -1
View File
@@ -372,7 +372,11 @@ class Portal:
@staticmethod
async def cleanup_room(intent, room_id, type="Portal"):
for user in await intent.get_room_members(room_id):
try:
members = await intent.get_room_members(room_id)
except MatrixRequestError:
members = []
for user in members:
if user != intent.mxid:
try:
await intent.kick(room_id, user, f"{type} deleted.")