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:
miruka
2019-04-19 02:07:01 -04:00
parent 11d900965a
commit 1d0cce402e
16 changed files with 146 additions and 58 deletions

View File

@@ -5,10 +5,12 @@ from typing import Dict, List, NamedTuple, Optional
from PyQt5.QtCore import QDateTime
from ..pyqt_future import PyQtFuture
class User(NamedTuple):
user_id: str
display_name: str
display_name: PyQtFuture
avatar_url: Optional[str] = None
status_message: Optional[str] = None