Key backup: Handle case where your onw sig is invalid

Sometimes life is just like that
pull/21833/head
David Baker 2019-04-09 13:22:35 +01:00
parent babed3e5ee
commit 7c1943ef4e
1 changed files with 7 additions and 1 deletions

View File

@ -227,11 +227,17 @@ export default class KeyBackupPanel extends React.PureComponent {
"Backup has a signature from <verify>unknown</verify> device with ID %(deviceId)s.",
{ deviceId: sig.deviceId }, { verify },
);
} else if (sig.device.getFingerprint() === MatrixClientPeg.get().getDeviceEd25519Key()) {
} else if (sig.device.getFingerprint() === MatrixClientPeg.get().getDeviceEd25519Key() && sig.valid) {
sigStatus = _t(
"Backup has a <validity>valid</validity> signature from this device",
{}, { validity },
);
} else if (sig.device.getFingerprint() === MatrixClientPeg.get().getDeviceEd25519Key() && !sig.valid) {
// it can happen...
sigStatus = _t(
"Backup has an <validity>invalid</validity> signature from this device",
{}, { validity },
);
} else if (sig.valid && sig.device.isVerified()) {
sigStatus = _t(
"Backup has a <validity>valid</validity> signature from " +