From 710dd56109172c24a160e9c13db755c52787ae09 Mon Sep 17 00:00:00 2001 From: miruka Date: Wed, 27 Nov 2019 10:03:49 -0400 Subject: [PATCH] Correct "Empty room" display --- TODO.md | 13 ++++++------- src/python/matrix_client.py | 2 +- src/qml/Chat/RoomHeader.qml | 2 +- src/qml/SidePane/RoomDelegate.qml | 3 +-- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/TODO.md b/TODO.md index 806276fc..ee4f3567 100644 --- a/TODO.md +++ b/TODO.md @@ -176,26 +176,25 @@ - Fetch all members when using the filter members bar - Direct chats category - - When inviting someone to direct chat, room is "Empty room" until accepted, it should be the peer's display name instead. - Animate RoomEventDelegate DayBreak apparition - Live-reloading accounts.json - nio - - RoomMessageMedia info attribute - - `AsyncClient.share_group_session`: send device batches concurrently - Running blocking DB function calls in executor - - Guard against asyncio OSError Network unreachable + - `AsyncClient.share_group_session`: send device batches concurrently + - RoomMessageMedia and RoomAvatarEvent info attributes + - `m.room.aliases` events - MatrixRoom invited members list + - When inviting someone to direct chat, room is "Empty room" until accepted, - Left room events after client reboot - `org.matrix.room.preview_urls` events - - `m.room.aliases` events - Support "Empty room (was ...)" after peer left - Previewing room without joining - - get content repo config API - - add the `resume()` method + - Get content repo config API + - Add the `resume()` method - See if we can turn all the Error classes into actual exceptions diff --git a/src/python/matrix_client.py b/src/python/matrix_client.py index 1d898d53..624bf96f 100644 --- a/src/python/matrix_client.py +++ b/src/python/matrix_client.py @@ -713,7 +713,7 @@ class MatrixClient(nio.AsyncClient): self.models[Room, self.user_id][room.room_id] = Room( room_id = room.room_id, - display_name = room.display_name, + display_name = room.display_name or "", avatar_url = room.gen_avatar_url or "", topic = HTML_FILTER.filter_inline(room.topic or ""), inviter_id = inviter, diff --git a/src/qml/Chat/RoomHeader.qml b/src/qml/Chat/RoomHeader.qml index 30b1977d..eb5818ab 100644 --- a/src/qml/Chat/RoomHeader.qml +++ b/src/qml/Chat/RoomHeader.qml @@ -30,7 +30,7 @@ Rectangle { HLabel { id: roomName - text: chatPage.roomInfo.display_name + text: chatPage.roomInfo.display_name || qsTr("Empty room") font.pixelSize: theme.fontSize.big color: theme.chat.roomHeader.name elide: Text.ElideRight diff --git a/src/qml/SidePane/RoomDelegate.qml b/src/qml/SidePane/RoomDelegate.qml index f02edfd3..2d1ad9c3 100644 --- a/src/qml/SidePane/RoomDelegate.qml +++ b/src/qml/SidePane/RoomDelegate.qml @@ -37,8 +37,7 @@ HTileDelegate { } title.color: theme.sidePane.room.name - title.text: model.data.display_name || "Empty room" - title.textFormat: model.data.display_name? Text.PlainText : Text.StyledText + title.text: model.data.display_name || qsTr("Empty room") additionalInfo.children: HIcon { svgName: "invite-received"