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.
This commit is contained in:
parent
665211a8d3
commit
552a4b53fb
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user