-
-
Notifications
You must be signed in to change notification settings - Fork 829
UI for blacklisting unverified devices per-room & globally #636
Conversation
(written blind; untested as yet)
(hm, even once #3020 is fixed, which I guess it now is, it'll probably need Dialog to support stacks of dialogs so that the user can jump in & out of verifying/blocking devices nicely) |
Ok. I have that on an unmerged branch, so I can land that.
…On 23 January 2017 18:31:57 GMT+00:00, Matthew Hodgson ***@***.***> wrote:
(hm, even once #3020 is fixed, which I guess it now is, it'll probably
need Dialog to support stacks of dialogs so that the user can jump in &
out of verifying/blocking devices nicely)
--
You are receiving this because you were assigned.
Reply to this email directly or view it on GitHub:
#636 (comment)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
Ok, some thoughts on this: Firstly this PR mixes two concepts. Let's tale them separately. Firstly, it adds the verify/blacklist buttons to the UnknownDeviceDialog.
Second, it includes the UI for twiddling the global blacklist setting. This is ok - though presumably in this case we will never see the UnknownDeviceDialog, so there's no point handling it specially? |
sounds plausible on all counts. sorry for mixing the two issues. |
(just merging) |
having just tried this, there are some minor problems:
Hum. |
That would imply we need to rethink what it means to be "known". |
i've fixed the verify/blacklist UI updating problem in the above commit. @richvdh PTAL. |
@@ -149,6 +149,23 @@ module.exports = { | |||
return MatrixClientPeg.get().setAccountData("im.vector.web.settings", settings); | |||
}, | |||
|
|||
getLocalSettings: function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be good to explain wtf a 'local setting' is. Turns out, it's a setting which is persisted in localstorage.
return JSON.parse(localSettingsString); | ||
}, | ||
|
||
getLocalSetting: function(type, defaultValue = null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type? why type?
return JSON.parse(localSettingsString); | ||
}, | ||
|
||
getLocalSetting: function(type, defaultValue = null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments on what the behaviour is if the setting is absent would be nice.
@@ -149,6 +149,23 @@ module.exports = { | |||
return MatrixClientPeg.get().setAccountData("im.vector.web.settings", settings); | |||
}, | |||
|
|||
getLocalSettings: function() { | |||
var localSettingsString = localStorage.getItem('mx_local_settings') || '{}'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ought to handle localStorage === undefined here
_renderLocalSetting: function(setting) { | ||
const client = MatrixClientPeg.get(); | ||
return <div className="mx_UserSettings_toggle" key={ setting.id }> | ||
<input id={ setting.id } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is crying out to be made a separate react component.
Don't enable encryption unless the box is checked!
var isGlobalBlacklistUnverified = UserSettingsStore.getLocalSettings().blacklistUnverifiedDevices; | ||
var isRoomBlacklistUnverified = this._isRoomBlacklistUnverified(); | ||
|
||
var settings = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please can we put parens around multi-line jsx?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bunch of stylistic nits which I'd love to see fixed, but realistically we want this in a release today. I've fixed the visible problems, so will land this
This should solve element-hq/element-web#2313, modulo hitting up against the regression in element-hq/element-web#3020.
It builds on top of #635, which should land first for sensible review.