Address review comments

This commit is contained in:
Richard van der Hoff 2017-06-05 17:58:11 +01:00
parent 7a9784fd6e
commit 32e3ea0601
3 changed files with 14 additions and 4 deletions

View file

@ -26,7 +26,7 @@ export default class KeyRequestHandler {
this._currentDevice = null; this._currentDevice = null;
// userId -> deviceId -> [keyRequest] // userId -> deviceId -> [keyRequest]
this._pendingKeyRequests = {}; this._pendingKeyRequests = Object.create(null);
} }
handleKeyRequest(keyRequest) { handleKeyRequest(keyRequest) {
@ -35,7 +35,7 @@ export default class KeyRequestHandler {
const requestId = keyRequest.requestId; const requestId = keyRequest.requestId;
if (!this._pendingKeyRequests[userId]) { if (!this._pendingKeyRequests[userId]) {
this._pendingKeyRequests[userId] = {}; this._pendingKeyRequests[userId] = Object.create(null);
} }
if (!this._pendingKeyRequests[userId][deviceId]) { if (!this._pendingKeyRequests[userId][deviceId]) {
this._pendingKeyRequests[userId][deviceId] = []; this._pendingKeyRequests[userId][deviceId] = [];

View file

@ -20,6 +20,14 @@ import sdk from '../../../index';
import { _t } from '../../../languageHandler'; import { _t } from '../../../languageHandler';
/**
* Dialog which asks the user whether they want to share their keys with
* an unverified device.
*
* onFinished is called with `true` if the key should be shared, `false` if it
* should not, and `undefined` if the dialog is cancelled. (In other words:
* truthy: do the key share. falsy: don't share the keys).
*/
export default React.createClass({ export default React.createClass({
propTypes: { propTypes: {
matrixClient: React.PropTypes.object.isRequired, matrixClient: React.PropTypes.object.isRequired,
@ -155,7 +163,7 @@ export default React.createClass({
return ( return (
<BaseDialog className='mx_KeyShareRequestDialog' <BaseDialog className='mx_KeyShareRequestDialog'
onFinished={this.props.onFinished} onFinished={this.props.onFinished}
title='Encryption key request' title={_t('Encryption key request')}
> >
{content} {content}
</BaseDialog> </BaseDialog>

View file

@ -809,5 +809,7 @@
"Share without verifying": "Share without verifying", "Share without verifying": "Share without verifying",
"Ignore request": "Ignore request", "Ignore request": "Ignore request",
"You added a new device '%(displayName)s', which is requesting encryption keys.": "You added a new device '%(displayName)s', which is requesting encryption keys.", "You added a new device '%(displayName)s', which is requesting encryption keys.": "You added a new device '%(displayName)s', which is requesting encryption keys.",
"Your unverified device '%(displayName)s' is requesting encryption keys.": "Your unverified device '%(displayName)s' is requesting encryption keys." "Your unverified device '%(displayName)s' is requesting encryption keys.": "Your unverified device '%(displayName)s' is requesting encryption keys.",
"Encryption key request": "Encryption key request"
} }