aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorben <ben@nagy.contact>2025-05-12 14:48:37 -0700
committerben <ben@nagy.contact>2025-05-12 14:48:37 -0700
commit0649aa7409f92817cce984c34e5125489533eff0 (patch)
treeb64d6867e2fed3c77c9e3546c261668324ad20d6
parent4bd58c3d2f083a771e8b9c6103acda26b044cdf5 (diff)
Make quiet
-rw-r--r--matrix-mcnt.py18
1 files changed, 3 insertions, 15 deletions
diff --git a/matrix-mcnt.py b/matrix-mcnt.py
index ec8462c..aae0f37 100644
--- a/matrix-mcnt.py
+++ b/matrix-mcnt.py
@@ -56,7 +56,7 @@ async def main() -> None:
timeout=30000,
full_state=True
)
- print(f"Logged on as {USERNAME} to {HOME}")
+ #print(f"Logged on as {USERNAME} to {HOME}")
tmp_rooms = await get_rooms(client, sync_resp)
rooms = []
@@ -74,28 +74,16 @@ async def main() -> None:
for room in rooms:
print(f"{room['room_id']} | {room['display_name']} | Unread: {room['unread_count']}")
- num_unread = await sum_unread(client, rooms)
- print(f"unread messages: {num_unread}")
+ print(await sum_unread(client, rooms))
except Exception as e:
print(f"Error: {e}")
finally:
if client:
- print("logging out.")
+ #print("logging out.")
await client.logout()
await client.close()
-async def get_events(client: AsyncClient, room: MatrixRoom) -> list:
- response = await client.room_messages(
- room.room_id,
- start="",
- limit=100
- )
-
- if response and hasattr(response, "chunk"):
- return response.chunk
- return []
-
# SEE: room_context(), events.room_events.Event(), room_read_markers, and responses.RoomInfo() with unread_notifications
async def sum_unread(client: AsyncClient, rooms: list[dict]) -> int:
return sum(room["unread_count"] for room in rooms)