diff --git a/src/KeyRequestHandler.js b/src/KeyRequestHandler.js index 4354fba269..1da4922153 100644 --- a/src/KeyRequestHandler.js +++ b/src/KeyRequestHandler.js @@ -26,7 +26,7 @@ export default class KeyRequestHandler { this._currentDevice = null; // userId -> deviceId -> [keyRequest] - this._pendingKeyRequests = {}; + this._pendingKeyRequests = Object.create(null); } handleKeyRequest(keyRequest) { @@ -35,7 +35,7 @@ export default class KeyRequestHandler { const requestId = keyRequest.requestId; if (!this._pendingKeyRequests[userId]) { - this._pendingKeyRequests[userId] = {}; + this._pendingKeyRequests[userId] = Object.create(null); } if (!this._pendingKeyRequests[userId][deviceId]) { this._pendingKeyRequests[userId][deviceId] = []; diff --git a/src/components/views/dialogs/KeyShareDialog.js b/src/components/views/dialogs/KeyShareDialog.js index 5b66944dbc..61391d281c 100644 --- a/src/components/views/dialogs/KeyShareDialog.js +++ b/src/components/views/dialogs/KeyShareDialog.js @@ -20,6 +20,14 @@ import sdk from '../../../index'; 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({ propTypes: { matrixClient: React.PropTypes.object.isRequired, @@ -155,7 +163,7 @@ export default React.createClass({ return ( {content} diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 7421ccad76..f6c044deac 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -809,5 +809,7 @@ "Share without verifying": "Share without verifying", "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.", - "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" + }