From 552a4b53fb31aae15c6ca2b2e35da67a95f592a4 Mon Sep 17 00:00:00 2001 From: miruka Date: Thu, 29 Aug 2019 16:47:07 -0400 Subject: [PATCH] Use the now fixed nio.MatrixRoom.display_name The property behaves according to the Matrix standard starting from nio 0.5, no need to generate the room display name ourself anymore. --- src/python/matrix_client.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/python/matrix_client.py b/src/python/matrix_client.py index 90e31328..087dc9e9 100644 --- a/src/python/matrix_client.py +++ b/src/python/matrix_client.py @@ -404,12 +404,6 @@ class MatrixClient(nio.AsyncClient): async def register_nio_room(self, room: nio.MatrixRoom, left: bool = False, ) -> None: - # Generate the room name - name = room.name or room.canonical_alias - if not name: - name = room.group_name() - name = "" if name == "Empty room?" else name - # Add room try: last_ev = self.models[Room, self.user_id][room.room_id].last_event @@ -420,7 +414,7 @@ class MatrixClient(nio.AsyncClient): self.models[Room, self.user_id][room.room_id] = Room( room_id = room.room_id, - display_name = name, + display_name = room.display_name, avatar_url = room.gen_avatar_url or "", topic = room.topic or "", inviter_id = inviter,