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:
@@ -32,7 +32,7 @@ class SignalManager(QObject):
|
||||
self.connectClient(client)
|
||||
self.backend.models.accounts.append(User(
|
||||
user_id = client.userID,
|
||||
display_name = client.userID.lstrip("@").split(":")[0],
|
||||
display_name = self.backend.getUserDisplayName(client.userID),
|
||||
))
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ class SignalManager(QObject):
|
||||
item = Room(
|
||||
room_id = room_id,
|
||||
display_name = room.name or room.canonical_alias or group_name(),
|
||||
description = getattr(room, "topic", ""), # FIXME: outside init
|
||||
description = room.topic,
|
||||
)
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user