Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

very barebones support for warning users when rooms contain unknown devices #635

Merged
merged 12 commits into from
Feb 2, 2017

Conversation

ara4n
Copy link
Member

@ara4n ara4n commented Jan 21, 2017

Hopefully a step in the right direction towards fixing element-hq/element-web#2143

@ara4n
Copy link
Member Author

ara4n commented Jan 21, 2017

Stuff to be done here either before it lands or shortly afterwards:

  • List the unknown devices more nicely, giving links to their verify dialogs
  • List the miscreant users prettily, showing users by avatar & displayname
  • Consider putting m.new_device events in the timeline for the rooms they relate to, to give the user as much heads up as possible.

Rich: i hacked on this to try to unstick it, especially given the ongoing WA drama, and given it's the only technical insecurity that we know of in the impl. I'm unlikely to be able to work sensibly on it for the next week thanks to skiing, but if you could take a look it would be hugely appreciated.

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, looks good modulo a bit of quibbling, which I can pick up in a bit.

@@ -0,0 +1,73 @@
/*
Copyright 2015, 2016 OpenMarket Ltd
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<cough>

@@ -44,7 +44,7 @@ module.exports = React.createClass({

var cancelButton;
if (this.props.onCancelClick) {
cancelButton = <div className="mx_RoomHeader_cancelButton" onClick={this.props.onCancelClick}><img src="img/cancel.svg" width="18" height="18" alt="Cancel"/> </div>;
cancelButton = <div className="mx_RoomHeader_cancelButton" onClick={this.props.onCancelClick}><img src="img/cancel.svg" className="mx_filterFlipColor" width="18" height="18" alt="Cancel"/> </div>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks unrelated?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops; random trivial dark theme fix that snuck in. should have gone straight to develop probably.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, factored out to #651 along with a fix that removes some c&p and therefore fixes it for the room settings too...

limitations under the License.
*/

var React = require("react");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice to use import rather than require


var React = require("react");
var sdk = require('../../../index');
var MatrixClientPeg = require("../../../MatrixClientPeg");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this appears to be unused. And if it wasn't, I'd be asking you to pass in the matrixClient in a property, rather than adding more references to MatrixClientPeg.

<h4>We strongly recommend you verify them before continuing.</h4>
<p>Unknown devices:
<ul>{
Object.keys(this.props.devices).map(userId=>{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could do with factoring this out to a separate function

@richvdh
Copy link
Member

richvdh commented Jan 26, 2017

I reworded the warning somewhat: 2c7b3d9.

Modulo element-hq/element-web#3018, which I will look at now, I think this is good to merge, and we can see how it feels and go on to arguing about the follow-ups. WDYT, @ara4n ?

@richvdh richvdh assigned ara4n and unassigned richvdh Jan 26, 2017
@ara4n
Copy link
Member Author

ara4n commented Jan 26, 2017

rewrite wfm, as does landing it.

@richvdh
Copy link
Member

richvdh commented Jan 27, 2017

FTR, I gave up trying to fix element-hq/element-web#3018, and am unsure whether we want to land this without it.

@ara4n
Copy link
Member Author

ara4n commented Feb 2, 2017

i've fixed 3018 for the instance of UnknownDeviceDialog in 5e5b7f8. @richvdh PTAL so we can escape this at last.....

@ara4n ara4n assigned richvdh and unassigned ara4n Feb 2, 2017
@@ -177,7 +177,7 @@ class ModalManager {

var modal = this._modals[0];
var dialog = (
<div className={"mx_Dialog_wrapper " + modal.className}>
<div className={"mx_Dialog_wrapper " + (modal.className ? modal.className : '') }>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we have https://github.com/JedWatson/classnames for this? fine, anyway

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we do. but it's arguably slightly overkill for something trivial like this. plus this was just fixing someone else's bug.

@richvdh
Copy link
Member

richvdh commented Feb 2, 2017

The CSS for this is in element-hq/element-web@b137c82.

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ara4n ara4n merged commit e45ac36 into develop Feb 2, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants