tweaks
This commit is contained in:
+5
-3
@@ -9,7 +9,7 @@ import asyncio
|
||||
import sqlite3
|
||||
import time
|
||||
import sys
|
||||
from nio import AsyncClient, LoginResponse
|
||||
from nio import AsyncClient, LoginResponse, RoomMessagesResponse, SyncResponse
|
||||
from room import Room
|
||||
|
||||
|
||||
@@ -78,7 +78,9 @@ class UserListManager:
|
||||
return []
|
||||
|
||||
# Sync to get room state
|
||||
await self.room.client.sync(timeout=3000)
|
||||
sync_resp = await self.room.client.sync(timeout=3000)
|
||||
if not isinstance(sync_resp, SyncResponse):
|
||||
print(f"Sync failed: {sync_resp}")
|
||||
|
||||
# Get the room object
|
||||
room_obj = self.room.client.rooms.get(self.room.config.room_id)
|
||||
@@ -124,7 +126,7 @@ class UserListManager:
|
||||
limit=batch_size
|
||||
)
|
||||
|
||||
if not response.chunk:
|
||||
if not isinstance(response, RoomMessagesResponse) or not response.chunk:
|
||||
break
|
||||
|
||||
fetched += len(response.chunk)
|
||||
|
||||
Reference in New Issue
Block a user