Query other users's device keys

This commit is contained in:
miruka 2019-05-06 23:27:31 -04:00
parent 5ff82471fc
commit e9592a7289
2 changed files with 17 additions and 6 deletions

View File

@ -11,6 +11,7 @@
- `MessageDelegate.qml:63: TypeError: 'reloadPreviousItem' not a function` - `MessageDelegate.qml:63: TypeError: 'reloadPreviousItem' not a function`
- UI - UI
- "the tree arrows could be smaller"
- Improve SidePane appearance when at min width - Improve SidePane appearance when at min width
- Accounts delegates background - Accounts delegates background
- Server selection - Server selection
@ -38,6 +39,7 @@
- Client improvements - Client improvements
- Initial sync filter and lazy load, see weechat-matrix `_handle_login()` - Initial sync filter and lazy load, see weechat-matrix `_handle_login()`
- See also `handle_response()`'s `keys_query` request
- HTTP/2 - HTTP/2
- `retry_after_ms` when rate-limited - `retry_after_ms` when rate-limited
- Direct chats category - Direct chats category

View File

@ -81,6 +81,18 @@ class Client(QObject):
return self.nio.user_id return self.nio.user_id
@futurize(pyqt=False)
def _keys_upload(self) -> None:
print("uploading key")
self.net.talk(self.nio.keys_upload)
@futurize(max_instances=1, pyqt=False)
def _keys_query(self) -> None:
print("querying keys")
self.net.talk(self.nio.keys_query)
@pyqtSlot(str, result="QVariant") @pyqtSlot(str, result="QVariant")
@pyqtSlot(str, str, result="QVariant") @pyqtSlot(str, str, result="QVariant")
@futurize() @futurize()
@ -108,12 +120,6 @@ class Client(QObject):
return self return self
@futurize(pyqt=False)
def _keys_upload(self) -> None:
print("uploading key")
self.net.talk(self.nio.keys_upload)
@pyqtSlot(result="QVariant") @pyqtSlot(result="QVariant")
@futurize() @futurize()
def logout(self) -> "Client": def logout(self) -> "Client":
@ -144,6 +150,9 @@ class Client(QObject):
if self.nio.should_upload_keys: if self.nio.should_upload_keys:
self._keys_upload() self._keys_upload()
if self.nio.should_query_keys:
self._keys_query()
for room_id, room_info in response.rooms.invite.items(): for room_id, room_info in response.rooms.invite.items():
for ev in room_info.invite_state: for ev in room_info.invite_state:
member_ev = isinstance(ev, nio.InviteMemberEvent) member_ev = isinstance(ev, nio.InviteMemberEvent)