You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-05 23:10:41 +03:00
Set E2E room status to warning when crypto is disabled
When crypto is disabled for the current device, we can't tell whether there are unverified devices since we aren't tracking devices at all. Let's be safe and default to the warning state. See also https://github.com/matrix-org/matrix-js-sdk/pull/889
This commit is contained in:
@@ -730,8 +730,19 @@ module.exports = React.createClass({
|
|||||||
if (!MatrixClientPeg.get().isRoomEncrypted(room.roomId)) {
|
if (!MatrixClientPeg.get().isRoomEncrypted(room.roomId)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!MatrixClientPeg.get().isCryptoEnabled()) {
|
||||||
|
// If crypto is not currently enabled, we aren't tracking devices at all,
|
||||||
|
// so we don't know what the answer is. Let's error on the safe side and show
|
||||||
|
// a warning for this case.
|
||||||
|
this.setState({
|
||||||
|
e2eStatus: "warning",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
room.hasUnverifiedDevices().then((hasUnverifiedDevices) => {
|
room.hasUnverifiedDevices().then((hasUnverifiedDevices) => {
|
||||||
this.setState({e2eStatus: hasUnverifiedDevices ? "warning" : "verified"});
|
this.setState({
|
||||||
|
e2eStatus: hasUnverifiedDevices ? "warning" : "verified",
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user