Proper display name retrieval implementation
For any name not found in rooms data, rely on new nio.HttpClient.get_displayname() function to get and cache it, e.g. for our own name if no room is joined and past events from users who left the room. @futurize now returns PyQtFuture objects, wrapper for the concurrent.futures.Future objects that can be used from QML, to ensure name retrieval does not block the GUI.
This commit is contained in:
@@ -21,7 +21,7 @@ ColumnLayout {
|
||||
|
||||
Base.HLabel {
|
||||
id: "accountLabel"
|
||||
text: display_name
|
||||
text: display_name.value || user_id
|
||||
elide: Text.ElideRight
|
||||
maximumLineCount: 1
|
||||
Layout.fillWidth: true
|
||||
|
@@ -15,7 +15,7 @@ function get_last_room_event_text(room_id) {
|
||||
|
||||
if (! found) { return "" }
|
||||
|
||||
var name = Backend.getUser(ev.dict.sender).display_name
|
||||
var name = Backend.getUserDisplayName(ev.dict.sender, false).result()
|
||||
var undecryptable = ev.type === "OlmEvent" || ev.type === "MegolmEvent"
|
||||
|
||||
if (undecryptable || ev.type.startsWith("RoomMessage")) {
|
||||
|
Reference in New Issue
Block a user