-
Verify by emoji
+
{_t("Verify by emoji")}
{_t("If you can't scan the code above, verify by comparing unique emoji.")}
{ button }
diff --git a/src/components/views/verification/VerificationQREmojiOptions.js b/src/components/views/verification/VerificationQREmojiOptions.js
new file mode 100644
index 0000000000..d72c6951fe
--- /dev/null
+++ b/src/components/views/verification/VerificationQREmojiOptions.js
@@ -0,0 +1,82 @@
+/*
+Copyright 2020 The Matrix.org Foundation C.I.C.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+import React from 'react';
+import PropTypes from 'prop-types';
+import { _t } from '../../../languageHandler';
+import AccessibleButton from "../elements/AccessibleButton";
+import {replaceableComponent} from "../../../utils/replaceableComponent";
+import VerificationQRCode from "../elements/crypto/VerificationQRCode";
+import {VerificationRequest} from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest";
+import Spinner from "../elements/Spinner";
+
+@replaceableComponent("views.verification.VerificationQREmojiOptions")
+export default class VerificationQREmojiOptions extends React.Component {
+ static propTypes = {
+ request: PropTypes.object.isRequired,
+ onCancel: PropTypes.func.isRequired,
+ onStartEmoji: PropTypes.func.isRequired,
+ };
+
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ qrProps: null,
+ };
+
+ this._prepareQrCode(props.request);
+ }
+
+ async _prepareQrCode(request: VerificationRequest) {
+ try {
+ const props = await VerificationQRCode.getPropsForRequest(request);
+ this.setState({qrProps: props});
+ } catch (e) {
+ console.error(e);
+ // We just won't show a QR code
+ }
+ }
+
+ render() {
+ let qrCode =
;
+ if (this.state.qrProps) {
+ qrCode =
;
+ }
+ return (
+
+ {_t("Verify this session by completing one of the following:")}
+
+
+
{_t("Scan this unique code")}
+ {qrCode}
+
+
{_t("or")}
+
+
{_t("Compare unique emoji")}
+
{_t("Compare a unique set of emoji if you don't have a camera on either device")}
+
+ {_t("Start")}
+
+
+
+
+ {_t("Cancel")}
+
+
+ );
+ }
+}
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index 72a4b305f0..e94420d097 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -452,6 +452,12 @@
"You've successfully verified this user.": "You've successfully verified this user.",
"Secure messages with this user are end-to-end encrypted and not able to be read by third parties.": "Secure messages with this user are end-to-end encrypted and not able to be read by third parties.",
"Got It": "Got It",
+ "Verify this session by completing one of the following:": "Verify this session by completing one of the following:",
+ "Scan this unique code": "Scan this unique code",
+ "or": "or",
+ "Compare unique emoji": "Compare unique emoji",
+ "Compare a unique set of emoji if you don't have a camera on either device": "Compare a unique set of emoji if you don't have a camera on either device",
+ "Start": "Start",
"Confirm the emoji below are displayed on both devices, in the same order:": "Confirm the emoji below are displayed on both devices, in the same order:",
"Verify this user by confirming the following emoji appear on their screen.": "Verify this user by confirming the following emoji appear on their screen.",
"Verify this device by confirming the following number appears on its screen.": "Verify this device by confirming the following number appears on its screen.",
@@ -1187,6 +1193,7 @@
"Security": "Security",
"Verify by emoji": "Verify by emoji",
"Verify by comparing unique emoji.": "Verify by comparing unique emoji.",
+ "Verify by scanning": "Verify by scanning",
"Ask %(displayName)s to scan your code:": "Ask %(displayName)s to scan your code:",
"If you can't scan the code above, verify by comparing unique emoji.": "If you can't scan the code above, verify by comparing unique emoji.",
"You've successfully verified %(displayName)s!": "You've successfully verified %(displayName)s!",
@@ -1642,6 +1649,7 @@
"Upload %(count)s other files|one": "Upload %(count)s other file",
"Cancel All": "Cancel All",
"Upload Error": "Upload Error",
+ "Verification Request": "Verification Request",
"A widget would like to verify your identity": "A widget would like to verify your identity",
"A widget located at %(widgetUrl)s would like to verify your identity. By allowing this, the widget will be able to verify your user ID, but not perform actions as you.": "A widget located at %(widgetUrl)s would like to verify your identity. By allowing this, the widget will be able to verify your user ID, but not perform actions as you.",
"Remember my selection for this widget": "Remember my selection for this widget",
@@ -1853,7 +1861,6 @@
"Review terms and conditions": "Review terms and conditions",
"Old cryptography data detected": "Old cryptography data detected",
"Data from an older version of Riot has been detected. This will have caused end-to-end cryptography to malfunction in the older version. End-to-end encrypted messages exchanged recently whilst using the older version may not be decryptable in this version. This may also cause messages exchanged with this version to fail. If you experience problems, log out and back in again. To retain message history, export and re-import your keys.": "Data from an older version of Riot has been detected. This will have caused end-to-end cryptography to malfunction in the older version. End-to-end encrypted messages exchanged recently whilst using the older version may not be decryptable in this version. This may also cause messages exchanged with this version to fail. If you experience problems, log out and back in again. To retain message history, export and re-import your keys.",
- "Verification Request": "Verification Request",
"Logout": "Logout",
"%(creator)s created and configured the room.": "%(creator)s created and configured the room.",
"Your Communities": "Your Communities",
@@ -1928,7 +1935,6 @@
"Could not load user profile": "Could not load user profile",
"Complete security": "Complete security",
"Verify this session to grant it access to encrypted messages.": "Verify this session to grant it access to encrypted messages.",
- "Start": "Start",
"Session verified": "Session verified",
"Your new session is now verified. It has access to your encrypted messages, and other users will see it as trusted.": "Your new session is now verified. It has access to your encrypted messages, and other users will see it as trusted.",
"Your new session is now verified. Other users will see it as trusted.": "Your new session is now verified. Other users will see it as trusted.",