Implement blacklisting from verification key popup
This commit is contained in:
parent
bcbc356a98
commit
edc73c6952
|
@ -1331,6 +1331,11 @@ class MatrixClient(nio.AsyncClient):
|
|||
self.verify_device(self.olm.device_store[user_id][device_id])
|
||||
|
||||
|
||||
async def blacklist_device_id(self, user_id: str, device_id: str) -> None:
|
||||
"""Mark a device as blacklisted."""
|
||||
|
||||
self.blacklist_device(self.olm.device_store[user_id][device_id])
|
||||
|
||||
|
||||
# Functions to register/modify data into models
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ HTile {
|
|||
property string userId
|
||||
|
||||
signal verified()
|
||||
signal blacklisted()
|
||||
signal renameRequest(string name)
|
||||
|
||||
|
||||
|
@ -157,6 +158,7 @@ HTile {
|
|||
ed25519Key: model.ed25519_key,
|
||||
deviceIsCurrent: model.type === "current",
|
||||
verifiedCallback: deviceTile.verified,
|
||||
blacklistedCallback: deviceTile.blacklisted,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
|
|
@ -80,6 +80,7 @@ HColumnPage {
|
|||
view: deviceList
|
||||
userId: page.userId
|
||||
onVerified: page.loadDevices()
|
||||
onBlacklisted: page.loadDevices()
|
||||
onRenameRequest: name => renameDevice(model.index, name)
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ HFlickableColumnPopup {
|
|||
property string ed25519Key
|
||||
property bool deviceIsCurrent: false
|
||||
property var verifiedCallback: null
|
||||
property var blacklistedCallback: null
|
||||
|
||||
|
||||
page.footer: ButtonLayout {
|
||||
|
@ -43,8 +44,17 @@ HFlickableColumnPopup {
|
|||
text: qsTr("They differ")
|
||||
icon.name: "device-blacklisted"
|
||||
onClicked: {
|
||||
// XXX
|
||||
popup.close()
|
||||
loading = true
|
||||
|
||||
py.callClientCoro(
|
||||
userId,
|
||||
"blacklist_device_id",
|
||||
[deviceOwner, deviceId],
|
||||
() => {
|
||||
if (blacklistedCallback) blacklistedCallback()
|
||||
popup.close()
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user