From 237084da7866432321ac52fcc7de74e8ec6c1075 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 11 Apr 2020 23:46:58 +0100 Subject: [PATCH 01/86] wrap node-qrcode in a React FC and use it for ShareDialog instead of qrcode-react Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- package.json | 2 +- res/css/views/dialogs/_ShareDialog.scss | 9 +- src/components/views/dialogs/ShareDialog.js | 4 +- src/components/views/elements/QRCode.tsx | 50 +++++ yarn.lock | 214 ++------------------ 5 files changed, 77 insertions(+), 202 deletions(-) create mode 100644 src/components/views/elements/QRCode.tsx diff --git a/package.json b/package.json index 616f3f541e..02ec206ee3 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,6 @@ "project-name-generator": "^2.1.7", "prop-types": "^15.5.8", "qrcode": "^1.4.4", - "qrcode-react": "^0.1.16", "qs": "^6.6.0", "react": "^16.9.0", "react-addons-css-transition-group": "15.6.2", @@ -118,6 +117,7 @@ "@babel/register": "^7.7.4", "@peculiar/webcrypto": "^1.0.22", "@types/classnames": "^2.2.10", + "@types/qrcode": "^1.3.4", "@types/react": "16.9", "babel-eslint": "^10.0.3", "babel-jest": "^24.9.0", diff --git a/res/css/views/dialogs/_ShareDialog.scss b/res/css/views/dialogs/_ShareDialog.scss index 9a2f67dea3..3c984bbd1b 100644 --- a/res/css/views/dialogs/_ShareDialog.scss +++ b/res/css/views/dialogs/_ShareDialog.scss @@ -64,12 +64,15 @@ limitations under the License. .mx_ShareDialog_qrcode_container { float: left; - background-color: #ffffff; - padding: 5px; // makes qr code more readable in dark theme - border-radius: 5px; height: 256px; width: 256px; margin-right: 64px; + + img { + width: 100%; + height: 100%; + border-radius: 8px; + } } .mx_ShareDialog_social_container { diff --git a/src/components/views/dialogs/ShareDialog.js b/src/components/views/dialogs/ShareDialog.js index 1bc9decd39..a2554c3dcf 100644 --- a/src/components/views/dialogs/ShareDialog.js +++ b/src/components/views/dialogs/ShareDialog.js @@ -19,7 +19,7 @@ import PropTypes from 'prop-types'; import {Room, User, Group, RoomMember, MatrixEvent} from 'matrix-js-sdk'; import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; -import QRCode from 'qrcode-react'; +import QRCode from "../elements/QRCode"; import {RoomPermalinkCreator, makeGroupPermalink, makeUserPermalink} from "../../../utils/permalinks/Permalinks"; import * as ContextMenu from "../../structures/ContextMenu"; import {toRightOf} from "../../structures/ContextMenu"; @@ -213,7 +213,7 @@ export default class ShareDialog extends React.Component {
- +
{ diff --git a/src/components/views/elements/QRCode.tsx b/src/components/views/elements/QRCode.tsx new file mode 100644 index 0000000000..5e5db8cf93 --- /dev/null +++ b/src/components/views/elements/QRCode.tsx @@ -0,0 +1,50 @@ +/* +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 * as React from "react"; +import {toDataURL, QRCodeSegment, QRCodeToDataURLOptions} from "qrcode"; + +import {_t} from "../../../languageHandler"; +import Spinner from "./Spinner"; + +interface IProps extends QRCodeToDataURLOptions { + data: string | QRCodeSegment[]; +} + +const defaultOptions: QRCodeToDataURLOptions = { + errorCorrectionLevel: 'L', // we want it as trivial-looking as possible +}; + +const QRCode: React.FC = ({data, ...options}) => { + const [dataUri, setUri] = React.useState(null); + React.useEffect(() => { + let cancelled = false; + toDataURL(data, {...defaultOptions, ...options}).then(uri => { + if (cancelled) return; + setUri(uri); + }); + return () => { + cancelled = true; + }; + }, [data, options]); + + + return
+ { dataUri ? {_t("QR: } +
; +}; + +export default QRCode; diff --git a/yarn.lock b/yarn.lock index 538a049bff..05716ae985 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1267,6 +1267,13 @@ resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw== +"@types/qrcode@^1.3.4": + version "1.3.4" + resolved "https://registry.yarnpkg.com/@types/qrcode/-/qrcode-1.3.4.tgz#984d97bb72caa558d470158701081ccb712f616b" + integrity sha512-aILE5yvKaqQXlY0YPMEYwK/KwdD43fwQTyagj0ffBBTQj8h//085Zp8LUrOnZ9FT69x64f5UgDo0EueY4BPAdg== + dependencies: + "@types/node" "*" + "@types/react@16.9": version "16.9.32" resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.32.tgz#f6368625b224604148d1ddf5920e4fefbd98d383" @@ -1496,11 +1503,6 @@ abab@^2.0.0: resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.3.tgz#623e2075e02eb2d3f2475e49f99c91846467907a" integrity sha512-tsFzPpcttalNjFBCFMqsKYQcWxxen1pgJR56by//QwvJc4/OUS3kPOOttx2tSIfjsylB0pYu7f5D3K1RCxUnUg== -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== - acorn-globals@^4.1.0: version "4.3.4" resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.4.tgz#9fa1926addc11c97308c4e66d7add0d40c3272e7" @@ -1634,19 +1636,11 @@ anymatch@~3.1.1: normalize-path "^3.0.0" picomatch "^2.0.4" -aproba@^1.0.3, aproba@^1.1.1: +aproba@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== -are-we-there-yet@~1.1.2: - version "1.1.5" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" - integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -2553,11 +2547,6 @@ console-browserify@^1.1.0: resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336" integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA== -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= - constants-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" @@ -2803,7 +2792,7 @@ debug@^2.2.0, debug@^2.3.3: dependencies: ms "2.0.0" -debug@^3.1.0, debug@^3.2.6: +debug@^3.1.0: version "3.2.6" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== @@ -2879,11 +2868,6 @@ delayed-stream@~1.0.0: resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= - des.js@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843" @@ -2897,11 +2881,6 @@ detect-file@^1.0.0: resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" integrity sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc= -detect-libc@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= - detect-newline@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" @@ -3916,13 +3895,6 @@ from2@^2.1.0: inherits "^2.0.1" readable-stream "^2.0.0" -fs-minipass@^1.2.5: - version "1.2.7" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" - integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== - dependencies: - minipass "^2.6.0" - fs-readdir-recursive@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" @@ -3985,20 +3957,6 @@ fuse.js@^2.2.0: resolved "https://registry.yarnpkg.com/fuse.js/-/fuse.js-2.7.4.tgz#96e420fde7ef011ac49c258a621314fe576536f9" integrity sha1-luQg/efvARrEnCWKYhMU/ldlNvk= -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - gensync@^1.0.0-beta.1: version "1.0.0-beta.1" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.1.tgz#58f4361ff987e5ff6e1e7a210827aa371eaac269" @@ -4196,11 +4154,6 @@ has-symbols@^1.0.0, has-symbols@^1.0.1: resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== -has-unicode@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= - has-value@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" @@ -4388,7 +4341,7 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" -iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: +iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@~0.4.13: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -4405,13 +4358,6 @@ iferr@^0.1.5: resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" integrity sha1-xg7taebY/bazEEofy8ocGS3FtQE= -ignore-walk@^3.0.1: - version "3.0.3" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.3.tgz#017e2447184bfeade7c238e4aefdd1e8f95b1e37" - integrity sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw== - dependencies: - minimatch "^3.0.4" - ignore@^4.0.3, ignore@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" @@ -5975,21 +5921,6 @@ minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.5, "minimist@~ 1.2.0": resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== -minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" - integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - -minizlib@^1.2.1: - version "1.3.3" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" - integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== - dependencies: - minipass "^2.9.0" - mississippi@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022" @@ -6014,7 +5945,7 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3: +mkdirp@^0.5.1, mkdirp@^0.5.3: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== @@ -6091,15 +6022,6 @@ nearley@^2.7.10: randexp "0.4.6" semver "^5.4.1" -needle@^2.2.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.4.1.tgz#14af48732463d7475696f937626b1b993247a56a" - integrity sha512-x/gi6ijr4B7fwl6WYL9FwlCvRQKGlUNvnceho8wxkwXqN8jvVmmmATTmZPRRG7b/yC1eode26C2HO9jl78Du9g== - dependencies: - debug "^3.2.6" - iconv-lite "^0.4.4" - sax "^1.2.4" - neo-async@^2.5.0, neo-async@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" @@ -6177,35 +6099,11 @@ node-notifier@^5.4.2: shellwords "^0.1.1" which "^1.3.0" -node-pre-gyp@*: - version "0.14.0" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz#9a0596533b877289bcad4e143982ca3d904ddc83" - integrity sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA== - dependencies: - detect-libc "^1.0.2" - mkdirp "^0.5.1" - needle "^2.2.1" - nopt "^4.0.1" - npm-packlist "^1.1.6" - npmlog "^4.0.2" - rc "^1.2.7" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^4.4.2" - node-releases@^1.1.53: version "1.1.53" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.53.tgz#2d821bfa499ed7c5dffc5e2f28c88e78a08ee3f4" integrity sha512-wp8zyQVwef2hpZ/dJH7SfSrIPD6YoJz6BDQDpGEkcA0s3LpAQoxBIYmfIq6QAhC1DhwsyCgTaTTcONwX8qzCuQ== -nopt@^4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.3.tgz#a375cad9d02fd921278d954c2254d5aa57e15e48" - integrity sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg== - dependencies: - abbrev "1" - osenv "^0.1.4" - normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" @@ -6238,27 +6136,6 @@ normalize-selector@^0.2.0: resolved "https://registry.yarnpkg.com/normalize-selector/-/normalize-selector-0.2.0.tgz#d0b145eb691189c63a78d201dc4fdb1293ef0c03" integrity sha1-0LFF62kRicY6eNIB3E/bEpPvDAM= -npm-bundled@^1.0.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.1.1.tgz#1edd570865a94cdb1bc8220775e29466c9fb234b" - integrity sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA== - dependencies: - npm-normalize-package-bin "^1.0.1" - -npm-normalize-package-bin@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz#6e79a41f23fd235c0623218228da7d9c23b8f6e2" - integrity sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA== - -npm-packlist@^1.1.6: - version "1.4.8" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.8.tgz#56ee6cc135b9f98ad3d51c1c95da22bbb9b2ef3e" - integrity sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A== - dependencies: - ignore-walk "^3.0.1" - npm-bundled "^1.0.1" - npm-normalize-package-bin "^1.0.1" - npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" @@ -6266,16 +6143,6 @@ npm-run-path@^2.0.0: dependencies: path-key "^2.0.0" -npmlog@^4.0.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - nth-check@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c" @@ -6425,11 +6292,6 @@ os-browserify@^0.3.0: resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= - os-locale@^3.0.0, os-locale@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" @@ -6439,19 +6301,11 @@ os-locale@^3.0.0, os-locale@^3.1.0: lcid "^2.0.0" mem "^4.0.0" -os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: +os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= -osenv@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" - integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.0" - p-defer@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" @@ -7006,18 +6860,6 @@ pvutils@latest: resolved "https://registry.yarnpkg.com/pvutils/-/pvutils-1.0.17.tgz#ade3c74dfe7178944fe44806626bd2e249d996bf" integrity sha512-wLHYUQxWaXVQvKnwIDWFVKDJku9XDCvyhhxoq8dc5MFdIlRenyPI9eSfEtcvgHgD7FlvCyGAlWgOzRnZD99GZQ== -qr.js@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/qr.js/-/qr.js-0.0.0.tgz#cace86386f59a0db8050fa90d9b6b0e88a1e364f" - integrity sha1-ys6GOG9ZoNuAUPqQ2baw6IoeNk8= - -qrcode-react@^0.1.16: - version "0.1.16" - resolved "https://registry.yarnpkg.com/qrcode-react/-/qrcode-react-0.1.16.tgz#d064999d510ffc3e55a9ca3ffcf6c203c69f1517" - integrity sha512-FK+QCfFqCQMSxUE1byzglERJQkwKqXYvYMCS+/Ad2zACJOfoHkHHtRqsQQPji7lfb1y1qCXLvL+3eP1hAfg8Ng== - dependencies: - qr.js "0.0.0" - qrcode@^1.4.4: version "1.4.4" resolved "https://registry.yarnpkg.com/qrcode/-/qrcode-1.4.4.tgz#f0c43568a7e7510a55efc3b88d9602f71963ea83" @@ -7096,7 +6938,7 @@ randomfill@^1.0.3: randombytes "^2.0.5" safe-buffer "^5.1.0" -rc@1.2.8, rc@^1.2.7, rc@^1.2.8: +rc@1.2.8, rc@^1.2.8: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== @@ -7254,7 +7096,7 @@ read-pkg@^4.0.1: parse-json "^4.0.0" pify "^3.0.0" -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -7614,7 +7456,7 @@ rimraf@2.6.3: dependencies: glob "^7.1.3" -rimraf@^2.4.3, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.3: +rimraf@^2.4.3, rimraf@^2.5.4, rimraf@^2.6.3: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== @@ -7776,7 +7618,7 @@ serialize-javascript@^2.1.2: resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-2.1.2.tgz#ecec53b0e0317bdc95ef76ab7074b7384785fa61" integrity sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ== -set-blocking@^2.0.0, set-blocking@~2.0.0: +set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= @@ -8112,7 +7954,7 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: +string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== @@ -8393,19 +8235,6 @@ tapable@^1.0.0, tapable@^1.1.3: resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== -tar@^4.4.2: - version "4.4.13" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" - integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA== - dependencies: - chownr "^1.1.1" - fs-minipass "^1.2.5" - minipass "^2.8.6" - minizlib "^1.2.1" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.3" - terser-webpack-plugin@^1.4.3: version "1.4.3" resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.3.tgz#5ecaf2dbdc5fb99745fd06791f46fc9ddb1c9a7c" @@ -9128,13 +8957,6 @@ which@^1.2.14, which@^1.2.9, which@^1.3.0, which@^1.3.1: dependencies: isexe "^2.0.0" -wide-align@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== - dependencies: - string-width "^1.0.2 || 2" - word-wrap@~1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" @@ -9219,7 +9041,7 @@ xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.1: resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== -yallist@^3.0.0, yallist@^3.0.2, yallist@^3.0.3: +yallist@^3.0.2: version "3.1.1" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== From 610fab7857d32ab9af557eae8fac1a1211d02713 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 11 Apr 2020 23:53:24 +0100 Subject: [PATCH 02/86] i18n and delint Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/elements/QRCode.tsx | 2 +- src/i18n/strings/en_EN.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/views/elements/QRCode.tsx b/src/components/views/elements/QRCode.tsx index 5e5db8cf93..9c867058c0 100644 --- a/src/components/views/elements/QRCode.tsx +++ b/src/components/views/elements/QRCode.tsx @@ -43,7 +43,7 @@ const QRCode: React.FC = ({data, ...options}) => { return
- { dataUri ? {_t("QR: } + { dataUri ? {_t("QR : }
; }; diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index ae8ed90402..832b53e67c 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1482,6 +1482,7 @@ "%(oneUser)smade no changes %(count)s times|one": "%(oneUser)smade no changes", "Power level": "Power level", "Custom level": "Custom level", + "QR Code": "QR Code", "Unable to load event that was replied to, it either does not exist or you do not have permission to view it.": "Unable to load event that was replied to, it either does not exist or you do not have permission to view it.", "In reply to ": "In reply to ", "Room alias": "Room alias", From 7c9a9b223acfb225e800b6fb878e5d917077a561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanislav=20Luke=C5=A1?= Date: Mon, 11 May 2020 17:01:36 +0000 Subject: [PATCH 03/86] Translated using Weblate (Czech) Currently translated at 93.5% (2154 of 2303 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/cs/ --- src/i18n/strings/cs.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/cs.json b/src/i18n/strings/cs.json index 4de5084106..d08ac6c0f5 100644 --- a/src/i18n/strings/cs.json +++ b/src/i18n/strings/cs.json @@ -2237,5 +2237,14 @@ "Waiting for you to accept on your other session…": "Čekáme na vaše přijetí v druhé relaci…", "Almost there! Is your other session showing the same shield?": "Téměř hotovo! Je vaše druhá relace také ověřená?", "Almost there! Is %(displayName)s showing the same shield?": "Téměř hotovo! Je relace %(displayName)s také ověřená?", - "You've successfully verified %(deviceName)s (%(deviceId)s)!": "Ověřili jste %(deviceName)s (%(deviceId)s)!" + "You've successfully verified %(deviceName)s (%(deviceId)s)!": "Ověřili jste %(deviceName)s (%(deviceId)s)!", + "If you cancel now, you won't complete your operation.": "Pokud teď akci stornujete, nebudete jí moci dokončit.", + "Review where you’re logged in": "Zobrazit kde jste přihlášení", + "New login. Was this you?": "Nové přihlášní. Jste to vy?", + "%(name)s is requesting verification": "%(name)s žádá o ověření", + "Failed to set topic": "Nepovedlo se nastavit téma", + "Command failed": "Příkaz selhal", + "Could not find user in room": "Nepovedlo se najít uživatele v místnosti", + "Please supply a widget URL or embed code": "Zadejte prosím URL widgetu nebo jeho kód", + "Send a bug report with logs": "Zaslat hlášení o chybě" } From 49375436480f04c6df0395b2199a4afe7226b282 Mon Sep 17 00:00:00 2001 From: Tirifto Date: Mon, 11 May 2020 16:11:46 +0000 Subject: [PATCH 04/86] Translated using Weblate (Esperanto) Currently translated at 100.0% (2303 of 2303 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/eo/ --- src/i18n/strings/eo.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/i18n/strings/eo.json b/src/i18n/strings/eo.json index 5e63974d12..4d270260fc 100644 --- a/src/i18n/strings/eo.json +++ b/src/i18n/strings/eo.json @@ -489,7 +489,7 @@ "Skip": "Preterpasi", "An error occurred: %(error_string)s": "Okazis eraro: %(error_string)s", "This will be your account name on the homeserver, or you can pick a different server.": "Tio ĉi estos la nomo de via konto sur la hejmservilo , aŭ vi povas elekti alian servilon.", - "Blacklist": "Malpermesi legadon de ĉifritaj mesaĝoj", + "Blacklist": "Malpermesi malĉifradon", "Unverify": "Malkontroli", "If you already have a Matrix account you can log in instead.": "Se vi jam havas Matrix-konton, vi povas saluti anstataŭe.", "Private Chat": "Privata babilo", @@ -664,7 +664,7 @@ "File to import": "Enportota dosiero", "Import": "Enporti", "Deleting a widget removes it for all users in this room. Are you sure you want to delete this widget?": "Forigo de fenestraĵo efektiviĝos por ĉiuj uzantoj en ĉi tiu ĉambro. Ĉu vi certe volas ĝin forigi?", - "Unblacklist": "Repermesi legadon de ĉifritaj mesaĝoj", + "Unblacklist": "Repermesi malĉifradon", "none": "neniu", "The version of Riot.im": "Tiu ĉi versio de Riot.im", "Your language of choice": "Via preferata lingvo", @@ -883,7 +883,7 @@ "Language and region": "Lingvo kaj regiono", "Theme": "Haŭto", "General": "Ĝenerala", - "In reply to ": "Respondante al ", + "In reply to ": "Responde al ", "Share Message": "Diskonigi", "Whether or not you're logged in (we don't record your username)": "Ĉu vi salutis aŭ ne (ni ne registras vian uzantonomon)", "You do not have permission to start a conference call in this room": "Vi ne havas permeson komenci grupvokon en ĉi tiu ĉambro", From dba98e17da693b4c4a4277059fed1cb6b905542e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Priit=20J=C3=B5er=C3=BC=C3=BCt?= Date: Mon, 11 May 2020 19:30:04 +0000 Subject: [PATCH 05/86] Translated using Weblate (Estonian) Currently translated at 44.5% (1024 of 2303 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/et/ --- src/i18n/strings/et.json | 71 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 3 deletions(-) diff --git a/src/i18n/strings/et.json b/src/i18n/strings/et.json index e2d4e93e43..95096a080d 100644 --- a/src/i18n/strings/et.json +++ b/src/i18n/strings/et.json @@ -238,7 +238,7 @@ "Remove %(name)s from the directory?": "Eemalda %(name)s kataloogist?", "Remove from Directory": "Eemalda kataloogist", "remove %(name)s from the directory.": "eemalda %(name)s kataloogist.", - "You seem to be uploading files, are you sure you want to quit?": "Tundub, et sa parasjagu laed faile üles, kas sa kindlasti soovid väljuda?", + "You seem to be uploading files, are you sure you want to quit?": "Tundub, et sa parasjagu laed faile üles. Kas sa kindlasti soovid väljuda?", "Failed to set direct chat tag": "Otsevestluse sildi lisamine ei õnnestunud", "Failed to remove tag %(tagName)s from room": "Sildi %(tagName)s eemaldamine jututoast ebaõnnestus", "Calls": "Kõned", @@ -543,7 +543,7 @@ "Start a conversation with someone using their name, username (like ) or email address.": "Alusta vestlust kasutades teise osapoole nime, kasutajanime (näiteks ) või e-posti aadressi.", "Go": "Mine", "Your message wasn't sent because this homeserver has hit its Monthly Active User Limit. Please contact your service administrator to continue using the service.": "Sinu sõnumit ei saadetud, kuna see koduserver on saavutanud igakuise aktiivsete kasutajate piiri. Teenuse kasutamiseks palun võta ühendust serveri haldajaga.", - "Add room": "LIsa jututuba", + "Add room": "Lisa jututuba", "%(senderName)s invited %(targetName)s.": "%(senderName)s kutsus vestlema kasutajat %(targetName)s.", "%(targetName)s joined the room.": "%(targetName)s liitus jututoaga.", "%(senderName)s answered the call.": "%(senderName)s vastas kõnele.", @@ -961,5 +961,70 @@ "Previous/next room or DM": "Eelmine/järgmine otsevestlus või jututuba", "Toggle the top left menu": "Lülita ülemine vasak menüü sisse/välja", "Activate selected button": "Aktiveeri valitud nupp", - "Toggle right panel": "Lülita parem paan sisse/välja" + "Toggle right panel": "Lülita parem paan sisse/välja", + "%(count)s of your messages have not been sent.|other": "Mõned sinu sõnumid on saatmata.", + "%(count)s of your messages have not been sent.|one": "Sinu sõnum on saatmata.", + "You seem to be in a call, are you sure you want to quit?": "Tundub, et sul parasjagu on kõne pooleli. Kas sa kindlasti soovid väljuda?", + "Unknown room %(roomId)s": "Tundmatu jututuba %(roomId)s", + "Room": "Jututuba", + "Failed to reject invite": "Kutse tagasilükkamine ei õnnestunud", + "Tried to load a specific point in this room's timeline, but you do not have permission to view the message in question.": "Üritasin laadida teatud hetke selle jututoa ajajoonelt, kuid sul ei ole õigusi selle sõnumi nägemiseks.", + "Failed to load timeline position": "Asukoha laadimine ajajoonel ei õnnestunud", + " (1/%(totalCount)s)": " (1/%(totalCount)s)", + "Guest": "Külaline", + "Uploading %(filename)s and %(count)s others|other": "Laen üles %(filename)s ning %(count)s muud faili", + "Uploading %(filename)s and %(count)s others|zero": "Laen üles %(filename)s", + "Uploading %(filename)s and %(count)s others|one": "Laen üles %(filename)s ning veel %(count)s faili", + "Verify this login": "Verifitseeri see sisselogimissessioon", + "Session verified": "Sessioon on verifitseeritud", + "Failed to send email": "E-kirja saatmine ebaõnnestus", + "The email address linked to your account must be entered.": "Sa pead sisestama oma kontoga seotud e-posti aadressi.", + "A new password must be entered.": "Palun sisesta uus salasõna.", + "New passwords must match each other.": "Uued salasõnad peavad omavahel klappima.", + "Changing your password will reset any end-to-end encryption keys on all of your sessions, making encrypted chat history unreadable. Set up Key Backup or export your room keys from another session before resetting your password.": "Salasõna muutmine tühistab kõik läbiva krüptimise võtmed sinu kõikides sessioonides ning seega muutub kogu sinu vestluste ajalugu loetamatuks. Palun kindlasti kas sea üles võtmete varundamine või ekspordi mõnest muust sessioonist jututubade võtmed enne senise salasõna tühistamist.", + "Your Matrix account on %(serverName)s": "Sinu Matrix'i konto serveris %(serverName)s", + "Your Matrix account on ": "Sinu Matrix'i kasutajakonto serveris ", + "This homeserver does not support login using email address.": "See koduserver ei võimalda e-posti aadressi kasutamist sisselogimisel.", + "Please contact your service administrator to continue using this service.": "Jätkamaks selle teenuse kasutamist palun võta ühendust oma teenuse haldajaga.", + "This account has been deactivated.": "See kasutajakonto on deaktiveeritud.", + "Incorrect username and/or password.": "Vigane kasutajanimi ja/või salasõna.", + "Please note you are logging into the %(hs)s server, not matrix.org.": "Sa kasutad sisselogimiseks serverit %(hs)s, mitte aga matrix.org'i.", + "Failed to perform homeserver discovery": "Koduserveri leidmine ebaõnnestus", + "The phone number entered looks invalid": "Sisestatud telefoninumber tundub vigane", + "This homeserver doesn't offer any login flows which are supported by this client.": "See koduserver ei paku ühtegi sisselogimislahendust, mida see klient toetab.", + "Error: Problem communicating with the given homeserver.": "Viga: Suhtlusel koduserveriga tekkis probleem.", + "Can't connect to homeserver via HTTP when an HTTPS URL is in your browser bar. Either use HTTPS or enable unsafe scripts.": "Kui aadressiribal on HTTPS-aadress, siis HTTP-protokolli kasutades ei saa ühendust koduserveriga. Palun pruugi HTTPS-protokolli või luba brauseris ebaturvaliste skriptide kasutamine.", + "Can't connect to homeserver - please check your connectivity, ensure your homeserver's SSL certificate is trusted, and that a browser extension is not blocking requests.": "Ei sa ühendust koduserveriga. Palun kontrolli, et sinu koduserveri SSL sertifikaat oleks usaldusväärne ning mõni brauseri lisamoodul ei blokeeri päringuid.", + "Syncing...": "Sünkroniseerin...", + "Signing In...": "Login sisse...", + "Create account": "Loo kasutajakonto", + "Failed to fetch avatar URL": "Ei õnnestunud laadida profiilipildi ehk avatari aadressi", + "Upload an avatar:": "Lae üles profiilipilt ehk avatar:", + "Unable to query for supported registration methods.": "Ei õnnestunud pärida toetatud registreerimismeetodite loendit.", + "Registration has been disabled on this homeserver.": "Väline registreerimine ei ole selles koduserveris kasutusel.", + "This server does not support authentication with a phone number.": "See server ei toeta autentimist telefoninumbri alusel.", + "Your new account (%(newAccountId)s) is registered, but you're already logged into a different account (%(loggedInUserId)s).": "Sinu uus kasutajakonto (%(newAccountId)s) on registreeritud, kuid sa jube oled sisse loginud teise kasutajakontoga (%(loggedInUserId)s).", + "Continue with previous account": "Jätka senise konto kasutamist", + "Log in to your new account.": "Logi sisse oma uuele kasutajakontole.", + "Registration Successful": "Registreerimine õnnestus", + "Create your account": "Loo endale konto", + "Confirm your identity by verifying this login from one of your other sessions, granting it access to encrypted messages.": "Kinnita oma isikusamasust verifitseerides seda sisselogimissessiooni mõnest oma muust sessioonist. Sellega tagad ka ligipääsu krüptitud sõnumitele.", + "This requires the latest Riot on your other devices:": "Selleks on sul vaja muudes seadmetes kõige uuemat Riot'i versiooni:", + "You're signed out": "Sa oled loginud välja", + "Clear personal data": "Kustuta privaatsed andmed", + "Warning: Your personal data (including encryption keys) is still stored in this session. Clear it if you're finished using this session, or want to sign in to another account.": "Hoiatus: Sinu privaatsed andmed (sealhulgas krüptimisvõtmed) on jätkuvalt salvestatud selles sessioonis. Eemalda nad, kui oled lõpetanud selle sessiooni kasutamise või soovid sisse logida muu kasutajakontoga.", + "Commands": "Käsud", + "Results from DuckDuckGo": "Otsingutulemused DuckDuckGo saidist", + "DuckDuckGo Results": "DuckDuckGo otsingutulemused", + "Emoji": "Emoji", + "Notify the whole room": "Teavita kogu jututuba", + "Users": "Kasutajad", + "unknown device": "tundmatu seade", + "NOT verified": "EI OLE verifitseeritud", + "verified": "verifitseeritud", + "Verification": "Verifitseerimine", + "Ed25519 fingerprint": "Ed25519 sõrmejälg", + "User ID": "Kasutajatunnus", + "Algorithm": "Algoritm", + "unencrypted": "krüptimata" } From 1f603090bee9e19b8bd6c7d853e4f6c61280713a Mon Sep 17 00:00:00 2001 From: Samu Voutilainen Date: Tue, 12 May 2020 04:38:12 +0000 Subject: [PATCH 06/86] Translated using Weblate (Finnish) Currently translated at 90.7% (2088 of 2303 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/fi/ --- src/i18n/strings/fi.json | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/fi.json b/src/i18n/strings/fi.json index 8135462d60..e8eef891be 100644 --- a/src/i18n/strings/fi.json +++ b/src/i18n/strings/fi.json @@ -2157,5 +2157,15 @@ "Syncing...": "Synkronoidaan...", "Signing In...": "Kirjaudutaan sisään...", "If you've joined lots of rooms, this might take a while": "Jos olet liittynyt moniin huoneisiin, tässä voi kestää hetken", - "Use your other device to continue…": "Jatka toisella laitteellasi…" + "Use your other device to continue…": "Jatka toisella laitteellasi…", + "Click the button below to confirm adding this email address.": "Klikkaa alapuolella olevaa painiketta lisätäksesi tämän sähköpostiosoitteen.", + "Click the button below to confirm adding this phone number.": "Klikkaa alapuolella olevaa painiketta lisätäksesi tämän puhelinnumeron.", + "If you cancel now, you won't complete your operation.": "Jos peruutat, toimintoa ei suoriteta loppuun.", + "Review where you’re logged in": "Tarkasta missä olet sisäänkirjautuneena", + "New login. Was this you?": "Uusi sisäänkirjautuminen. Olitko se sinä?", + "%(name)s is requesting verification": "%(name)s pyytää varmennusta", + "Sends a message as html, without interpreting it as markdown": "Lähettää viestin HTML-muodossa, tulkitsematta sitä Markdowniksi", + "Please supply a widget URL or embed code": "Anna sovelman osoite tai upotettava koodinpätkä", + "You signed in to a new session without verifying it:": "Olet kirjautunut uuteen istuntoon varmentamatta sitä:", + "Verify your other session using one of the options below.": "Varmenna toinen istuntosi käyttämällä yhtä seuraavista tavoista." } From ca30cf7ac9a38452ed79972fa536d968959fadbf Mon Sep 17 00:00:00 2001 From: Iria_kuro Date: Mon, 11 May 2020 11:10:34 +0000 Subject: [PATCH 07/86] Translated using Weblate (Korean) Currently translated at 76.1% (1752 of 2303 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/ko/ --- src/i18n/strings/ko.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/i18n/strings/ko.json b/src/i18n/strings/ko.json index 4271864216..cb8fb17da3 100644 --- a/src/i18n/strings/ko.json +++ b/src/i18n/strings/ko.json @@ -523,7 +523,7 @@ "Invite to this room": "이 방에 초대", "You cannot delete this message. (%(code)s)": "이 메시지를 삭제할 수 없습니다. (%(code)s)", "Thursday": "목요일", - "I understand the risks and wish to continue": "위험을 인지하고 계속하고 싶습니다", + "I understand the risks and wish to continue": "위험하다는 것을 이해했으며 계속하고 싶습니다", "Back": "돌아가기", "Failed to change settings": "설정 변경 실패", "Show message in desktop notification": "컴퓨터 알림에서 내용 보이기", @@ -1799,5 +1799,7 @@ "Session already verified!": "이미 검증된 세션입니다!", "WARNING: Session already verified, but keys do NOT MATCH!": "경고: 이미 검증된 세션이지만 키가 일치하지 않습니다!", "WARNING: KEY VERIFICATION FAILED! The signing key for %(userId)s and session %(deviceId)s is \"%(fprint)s\" which does not match the provided key \"%(fingerprint)s\". This could mean your communications are being intercepted!": "경고: 키 검증 실패! 제공된 키인 \"%(fingerprint)s\"가 사용자 %(userId)s와 %(deviceId)s 세션의 서명 키인 \"%(fprint)s\"와 일치하지 않습니다. 이는 통신이 탈취되고 있는 중일 수도 있다는 뜻입니다!", - "The signing key you provided matches the signing key you received from %(userId)s's session %(deviceId)s. Session marked as verified.": "사용자 %(userId)s의 세션 %(deviceId)s에서 받은 서명 키와 당신이 제공한 서명 키가 일치합니다. 세션이 검증되었습니다." + "The signing key you provided matches the signing key you received from %(userId)s's session %(deviceId)s. Session marked as verified.": "사용자 %(userId)s의 세션 %(deviceId)s에서 받은 서명 키와 당신이 제공한 서명 키가 일치합니다. 세션이 검증되었습니다.", + "Show more": "더 보기", + "Changing password will currently reset any end-to-end encryption keys on all sessions, making encrypted chat history unreadable, unless you first export your room keys and re-import them afterwards. In future this will be improved.": "비밀번호를 변경한다면 방의 암호화 키를 내보낸 후 다시 가져오지 않는 이상 모든 종단간 암호화 키는 초기화 될 것이고, 암호화된 대화 내역은 읽을 수 없게 될 것입니다. 이 문제는 추후에 개선될 것입니다." } From 8a1b38163583d4bfe0d36510e83cecfc23fc7533 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 12 May 2020 14:29:11 +0200 Subject: [PATCH 08/86] remove UI for upgrading 4S to sym enc --- src/DeviceListener.js | 8 ------- .../views/settings/CrossSigningPanel.js | 8 ------- .../views/toasts/SetupEncryptionToast.js | 24 ------------------- 3 files changed, 40 deletions(-) diff --git a/src/DeviceListener.js b/src/DeviceListener.js index d2ba8219db..27caba971e 100644 --- a/src/DeviceListener.js +++ b/src/DeviceListener.js @@ -225,14 +225,6 @@ export default class DeviceListener { }); } } - } else if (await cli.secretStorageKeyNeedsUpgrade()) { - ToastStore.sharedInstance().addOrReplaceToast({ - key: THIS_DEVICE_TOAST_KEY, - title: _t("Encryption upgrade available"), - icon: "verification_warning", - props: {kind: 'upgrade_ssss'}, - component: sdk.getComponent("toasts.SetupEncryptionToast"), - }); } else { // cross-signing is ready, and we don't need to upgrade encryption ToastStore.sharedInstance().dismissToast(THIS_DEVICE_TOAST_KEY); diff --git a/src/components/views/settings/CrossSigningPanel.js b/src/components/views/settings/CrossSigningPanel.js index cb04d2a018..c2c16615be 100644 --- a/src/components/views/settings/CrossSigningPanel.js +++ b/src/components/views/settings/CrossSigningPanel.js @@ -36,7 +36,6 @@ export default class CrossSigningPanel extends React.PureComponent { userSigningPrivateKeyCached: false, sessionBackupKeyCached: false, secretStorageKeyInAccount: false, - secretStorageKeyNeedsUpgrade: null, }; } @@ -88,7 +87,6 @@ export default class CrossSigningPanel extends React.PureComponent { const homeserverSupportsCrossSigning = await cli.doesServerSupportUnstableFeature("org.matrix.e2e_cross_signing"); const crossSigningReady = await cli.isCrossSigningReady(); - const secretStorageKeyNeedsUpgrade = await cli.secretStorageKeyNeedsUpgrade(); this.setState({ crossSigningPublicKeysOnDevice, @@ -100,7 +98,6 @@ export default class CrossSigningPanel extends React.PureComponent { secretStorageKeyInAccount, homeserverSupportsCrossSigning, crossSigningReady, - secretStorageKeyNeedsUpgrade, }); } @@ -150,7 +147,6 @@ export default class CrossSigningPanel extends React.PureComponent { secretStorageKeyInAccount, homeserverSupportsCrossSigning, crossSigningReady, - secretStorageKeyNeedsUpgrade, } = this.state; let errorSection; @@ -259,10 +255,6 @@ export default class CrossSigningPanel extends React.PureComponent { {_t("Homeserver feature support:")} {homeserverSupportsCrossSigning ? _t("exists") : _t("not found")} - - {_t("Secret Storage key format:")} - {secretStorageKeyNeedsUpgrade ? _t("outdated") : _t("up to date")} - {errorSection} diff --git a/src/components/views/toasts/SetupEncryptionToast.js b/src/components/views/toasts/SetupEncryptionToast.js index 75fd55378c..b5510e85b6 100644 --- a/src/components/views/toasts/SetupEncryptionToast.js +++ b/src/components/views/toasts/SetupEncryptionToast.js @@ -17,7 +17,6 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; import Modal from '../../../Modal'; -import { MatrixClientPeg } from '../../../MatrixClientPeg'; import * as sdk from "../../../index"; import { _t } from '../../../languageHandler'; import DeviceListener from '../../../DeviceListener'; @@ -31,7 +30,6 @@ export default class SetupEncryptionToast extends React.PureComponent { 'set_up_encryption', 'verify_this_session', 'upgrade_encryption', - 'upgrade_ssss', ]).isRequired, }; @@ -39,24 +37,6 @@ export default class SetupEncryptionToast extends React.PureComponent { DeviceListener.sharedInstance().dismissEncryptionSetup(); }; - async _waitForCompletion() { - if (this.props.kind === 'upgrade_ssss') { - return new Promise(resolve => { - const recheck = async () => { - const needsUpgrade = await MatrixClientPeg.get().secretStorageKeyNeedsUpgrade(); - if (!needsUpgrade) { - MatrixClientPeg.get().removeListener('accountData', recheck); - resolve(); - } - }; - MatrixClientPeg.get().on('accountData', recheck); - recheck(); - }); - } else { - return; - } - } - _onSetupClick = async () => { if (this.props.kind === "verify_this_session") { Modal.createTrackedDialog('Verify session', 'Verify session', SetupEncryptionDialog, @@ -68,7 +48,6 @@ export default class SetupEncryptionToast extends React.PureComponent { ); try { await accessSecretStorage(); - await this._waitForCompletion(); } finally { modal.close(); } @@ -82,8 +61,6 @@ export default class SetupEncryptionToast extends React.PureComponent { return _t('Verify yourself & others to keep your chats safe'); case 'verify_this_session': return _t('Other users may not trust it'); - case 'upgrade_ssss': - return _t('Update your secure storage'); } } @@ -92,7 +69,6 @@ export default class SetupEncryptionToast extends React.PureComponent { case 'set_up_encryption': return _t('Set up'); case 'upgrade_encryption': - case 'upgrade_ssss': return _t('Upgrade'); case 'verify_this_session': return _t('Verify'); From b3c641184ba5b66706b808fa34088e91cd1b4d90 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 12 May 2020 14:54:49 +0200 Subject: [PATCH 09/86] remove obsolete strings --- src/i18n/strings/en_EN.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index a24b2bde73..1d86947177 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -566,7 +566,6 @@ "Review": "Review", "Verify yourself & others to keep your chats safe": "Verify yourself & others to keep your chats safe", "Other users may not trust it": "Other users may not trust it", - "Update your secure storage": "Update your secure storage", "Set up": "Set up", "Upgrade": "Upgrade", "Verify": "Verify", @@ -618,9 +617,6 @@ "in account data": "in account data", "Homeserver feature support:": "Homeserver feature support:", "exists": "exists", - "Secret Storage key format:": "Secret Storage key format:", - "outdated": "outdated", - "up to date": "up to date", "Your homeserver does not support session management.": "Your homeserver does not support session management.", "Unable to load session list": "Unable to load session list", "Confirm deleting these sessions by using Single Sign On to prove your identity.|other": "Confirm deleting these sessions by using Single Sign On to prove your identity.", From c0632d01956bfc39fa2aac3b7618550b47272ccb Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 12 May 2020 17:17:17 -0600 Subject: [PATCH 10/86] Acquire a new session before enacting deactivation Fixes https://github.com/vector-im/riot-web/issues/13645 Every time the checkbox value changes we acquire a new session now. This avoids us asking the server to change its direction partway through the request. This causes a bit of UI jerk as the dialog goes from auth -> loading -> auth, however it's better than the alternative of reworking the entire UIA structure to support the `authData` dict changing. Originally this commit consisted of a `disabled` flag on the `InteractiveAuth` component which carried through to the stage's component, however it turns out that stack doesn't respect changes to the `authData` prop, which means the session ID we eventually send down is wrong (`erase: false` instead of the one with `erase: true`). Therefore, we do some logic to ensure we remount `InteractiveAuth` completely. Further work in this area is described in https://github.com/vector-im/riot-web/issues/13646 --- .../views/dialogs/DeactivateAccountDialog.js | 46 ++++++++++++------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/src/components/views/dialogs/DeactivateAccountDialog.js b/src/components/views/dialogs/DeactivateAccountDialog.js index b269ec2fdb..d84042011d 100644 --- a/src/components/views/dialogs/DeactivateAccountDialog.js +++ b/src/components/views/dialogs/DeactivateAccountDialog.js @@ -34,6 +34,7 @@ export default class DeactivateAccountDialog extends React.Component { shouldErase: false, errStr: null, authData: null, // for UIA + authEnabled: true, // see usages for information // A few strings that are passed to InteractiveAuth for design or are displayed // next to the InteractiveAuth component. @@ -42,21 +43,7 @@ export default class DeactivateAccountDialog extends React.Component { continueKind: null, }; - MatrixClientPeg.get().deactivateAccount(null, false).then(r => { - // If we got here, oops. The server didn't require any auth. - // Our application lifecycle will catch the error and do the logout bits. - // We'll try to log something in an vain attempt to record what happened (storage - // is also obliterated on logout). - console.warn("User's account got deactivated without confirmation: Server had no auth"); - this.setState({errStr: _t("Server did not require any authentication")}); - }).catch(e => { - if (e && e.httpStatus === 401 && e.data) { - // Valid UIA response - this.setState({authData: e.data}); - } else { - this.setState({errStr: _t("Server did not return valid authentication information.")}); - } - }); + this._initAuth(/* shouldErase= */false); } _onStagePhaseChange = (stage, phase) => { @@ -124,13 +111,40 @@ export default class DeactivateAccountDialog extends React.Component { _onEraseFieldChange = (ev) => { this.setState({ shouldErase: ev.target.checked, + + // Disable the auth form because we're going to have to reinitialize the auth + // information. We do this because we can't modify the parameters in the UIA + // session, and the user will have selected something which changes the request. + // Therefore, we throw away the last auth session and try a new one. + authEnabled: false, }); + + // As mentioned above, set up for auth again to get updated UIA session info + this._initAuth(/* shouldErase= */ev.target.checked); }; _onCancel() { this.props.onFinished(false); } + _initAuth(shouldErase) { + MatrixClientPeg.get().deactivateAccount(null, shouldErase).then(r => { + // If we got here, oops. The server didn't require any auth. + // Our application lifecycle will catch the error and do the logout bits. + // We'll try to log something in an vain attempt to record what happened (storage + // is also obliterated on logout). + console.warn("User's account got deactivated without confirmation: Server had no auth"); + this.setState({errStr: _t("Server did not require any authentication")}); + }).catch(e => { + if (e && e.httpStatus === 401 && e.data) { + // Valid UIA response + this.setState({authData: e.data, authEnabled: true}); + } else { + this.setState({errStr: _t("Server did not return valid authentication information.")}); + } + }); + }; + render() { const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog'); @@ -142,7 +156,7 @@ export default class DeactivateAccountDialog extends React.Component { } let auth =
{_t("Loading...")}
; - if (this.state.authData) { + if (this.state.authData && this.state.authEnabled) { auth = (
{this.state.bodyText} From 5e86dc2d60cf0a3b9bbfef6baabc23aafb2cccb6 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 12 May 2020 17:20:11 -0600 Subject: [PATCH 11/86] Update i18n strings --- src/i18n/strings/en_EN.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index b2fe409aa5..30e033bb43 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1589,13 +1589,13 @@ "You've previously used a newer version of Riot on %(host)s. To use this version again with end to end encryption, you will need to sign out and back in again. ": "You've previously used a newer version of Riot on %(host)s. To use this version again with end to end encryption, you will need to sign out and back in again. ", "Incompatible Database": "Incompatible Database", "Continue With Encryption Disabled": "Continue With Encryption Disabled", - "Server did not require any authentication": "Server did not require any authentication", - "Server did not return valid authentication information.": "Server did not return valid authentication information.", "Confirm your account deactivation by using Single Sign On to prove your identity.": "Confirm your account deactivation by using Single Sign On to prove your identity.", "Are you sure you want to deactivate your account? This is irreversible.": "Are you sure you want to deactivate your account? This is irreversible.", "Confirm account deactivation": "Confirm account deactivation", "To continue, please enter your password:": "To continue, please enter your password:", "There was a problem communicating with the server. Please try again.": "There was a problem communicating with the server. Please try again.", + "Server did not require any authentication": "Server did not require any authentication", + "Server did not return valid authentication information.": "Server did not return valid authentication information.", "This will make your account permanently unusable. You will not be able to log in, and no one will be able to re-register the same user ID. This will cause your account to leave all rooms it is participating in, and it will remove your account details from your identity server. This action is irreversible.": "This will make your account permanently unusable. You will not be able to log in, and no one will be able to re-register the same user ID. This will cause your account to leave all rooms it is participating in, and it will remove your account details from your identity server. This action is irreversible.", "Deactivating your account does not by default cause us to forget messages you have sent. If you would like us to forget your messages, please tick the box below.": "Deactivating your account does not by default cause us to forget messages you have sent. If you would like us to forget your messages, please tick the box below.", "Message visibility in Matrix is similar to email. Our forgetting your messages means that messages you have sent will not be shared with any new or unregistered users, but registered users who already have access to these messages will still have access to their copy.": "Message visibility in Matrix is similar to email. Our forgetting your messages means that messages you have sent will not be shared with any new or unregistered users, but registered users who already have access to these messages will still have access to their copy.", From 6d90a9d1a31170e497609eee9519ffd12ceff0af Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 12 May 2020 17:20:26 -0600 Subject: [PATCH 12/86] Appease the linter --- src/components/views/dialogs/DeactivateAccountDialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/dialogs/DeactivateAccountDialog.js b/src/components/views/dialogs/DeactivateAccountDialog.js index d84042011d..ffef2a30c7 100644 --- a/src/components/views/dialogs/DeactivateAccountDialog.js +++ b/src/components/views/dialogs/DeactivateAccountDialog.js @@ -143,7 +143,7 @@ export default class DeactivateAccountDialog extends React.Component { this.setState({errStr: _t("Server did not return valid authentication information.")}); } }); - }; + } render() { const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog'); From d8b6b7b976607d697125b4bdfa5c30b2912edf1c Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 13 May 2020 06:24:04 +0100 Subject: [PATCH 13/86] Pass screenAfterLogin through SSO in the callback url Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/BasePlatform.js | 14 ++++++-------- src/components/structures/MatrixChat.tsx | 9 ++++++++- src/components/structures/auth/Login.js | 7 +++++-- src/components/structures/auth/SoftLogout.js | 4 +++- src/components/views/auth/Welcome.js | 3 ++- src/components/views/elements/SSOButton.js | 5 +++-- 6 files changed, 27 insertions(+), 15 deletions(-) diff --git a/src/BasePlatform.js b/src/BasePlatform.js index 7214031586..8a950dc2e3 100644 --- a/src/BasePlatform.js +++ b/src/BasePlatform.js @@ -167,13 +167,9 @@ export default class BasePlatform { setLanguage(preferredLangs: string[]) {} - getSSOCallbackUrl(hsUrl: string, isUrl: string): URL { + getSSOCallbackUrl(hsUrl: string, isUrl: string, fragmentAfterLogin: string): URL { const url = new URL(window.location.href); - // XXX: at this point, the fragment will always be #/login, which is no - // use to anyone. Ideally, we would get the intended fragment from - // MatrixChat.screenAfterLogin so that you could follow #/room links etc - // through an SSO login. - url.hash = ""; + url.hash = fragmentAfterLogin || ""; url.searchParams.set("homeserver", hsUrl); url.searchParams.set("identityServer", isUrl); return url; @@ -183,9 +179,11 @@ export default class BasePlatform { * Begin Single Sign On flows. * @param {MatrixClient} mxClient the matrix client using which we should start the flow * @param {"sso"|"cas"} loginType the type of SSO it is, CAS/SSO. + * @param {string} fragmentAfterLogin the hash to pass to the app during sso callback. */ - startSingleSignOn(mxClient: MatrixClient, loginType: "sso"|"cas") { - const callbackUrl = this.getSSOCallbackUrl(mxClient.getHomeserverUrl(), mxClient.getIdentityServerUrl()); + startSingleSignOn(mxClient: MatrixClient, loginType: "sso" | "cas", fragmentAfterLogin: string) { + const callbackUrl = this.getSSOCallbackUrl(mxClient.getHomeserverUrl(), mxClient.getIdentityServerUrl(), + fragmentAfterLogin); window.location.href = mxClient.getSsoLoginUrl(callbackUrl.toString(), loginType); // redirect to SSO } diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 3929711406..8ff8abb190 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -1973,6 +1973,11 @@ export default class MatrixChat extends React.PureComponent { render() { // console.log(`Rendering MatrixChat with view ${this.state.view}`); + let fragmentAfterLogin = ""; + if (this.props.initialScreenAfterLogin) { + fragmentAfterLogin = `/${this.props.initialScreenAfterLogin.screen}`; + } + let view; if (this.state.view === Views.LOADING) { @@ -2052,7 +2057,7 @@ export default class MatrixChat extends React.PureComponent { } } else if (this.state.view === Views.WELCOME) { const Welcome = sdk.getComponent('auth.Welcome'); - view = ; + view = ; } else if (this.state.view === Views.REGISTER) { const Registration = sdk.getComponent('structures.auth.Registration'); view = ( @@ -2091,6 +2096,7 @@ export default class MatrixChat extends React.PureComponent { defaultDeviceDisplayName={this.props.defaultDeviceDisplayName} onForgotPasswordClick={this.onForgotPasswordClick} onServerConfigChange={this.onServerConfigChange} + fragmentAfterLogin={fragmentAfterLogin} {...this.getServerProperties()} /> ); @@ -2100,6 +2106,7 @@ export default class MatrixChat extends React.PureComponent { ); } else { diff --git a/src/components/structures/auth/Login.js b/src/components/structures/auth/Login.js index 5d3cb69417..e65a223bd6 100644 --- a/src/components/structures/auth/Login.js +++ b/src/components/structures/auth/Login.js @@ -355,7 +355,8 @@ export default createReactClass({ ev.preventDefault(); ev.stopPropagation(); const ssoKind = step === 'm.login.sso' ? 'sso' : 'cas'; - PlatformPeg.get().startSingleSignOn(this._loginLogic.createTemporaryClient(), ssoKind); + PlatformPeg.get().startSingleSignOn(this._loginLogic.createTemporaryClient(), ssoKind, + this.props.fragmentAfterLogin); } else { // Don't intercept - just go through to the register page this.onRegisterClick(ev); @@ -628,7 +629,9 @@ export default createReactClass({ + loginType={loginType} + fragmentAfterLogin={this.props.fragmentAfterLogin} + />
); }, diff --git a/src/components/structures/auth/SoftLogout.js b/src/components/structures/auth/SoftLogout.js index 08ab7e8a61..ede1041f8a 100644 --- a/src/components/structures/auth/SoftLogout.js +++ b/src/components/structures/auth/SoftLogout.js @@ -244,7 +244,9 @@ export default class SoftLogout extends React.Component {

{introText}

+ loginType={this.state.loginView === LOGIN_VIEW.CAS ? "cas" : "sso"} + fragmentAfterLogin={this.props.fragmentAfterLogin} + />
); } diff --git a/src/components/views/auth/Welcome.js b/src/components/views/auth/Welcome.js index 7cbcf65d3c..91ba368f70 100644 --- a/src/components/views/auth/Welcome.js +++ b/src/components/views/auth/Welcome.js @@ -45,7 +45,8 @@ export default class Welcome extends React.PureComponent { idBaseUrl: isUrl, }); const plaf = PlatformPeg.get(); - const callbackUrl = plaf.getSSOCallbackUrl(tmpClient.getHomeserverUrl(), tmpClient.getIdentityServerUrl()); + const callbackUrl = plaf.getSSOCallbackUrl(tmpClient.getHomeserverUrl(), tmpClient.getIdentityServerUrl(), + this.props.fragmentAfterLogin); return ( diff --git a/src/components/views/elements/SSOButton.js b/src/components/views/elements/SSOButton.js index 3e0757924b..1126ae3cd7 100644 --- a/src/components/views/elements/SSOButton.js +++ b/src/components/views/elements/SSOButton.js @@ -21,9 +21,9 @@ import PlatformPeg from "../../../PlatformPeg"; import AccessibleButton from "./AccessibleButton"; import {_t} from "../../../languageHandler"; -const SSOButton = ({matrixClient, loginType, ...props}) => { +const SSOButton = ({matrixClient, loginType, fragmentAfterLogin, ...props}) => { const onClick = () => { - PlatformPeg.get().startSingleSignOn(matrixClient, loginType); + PlatformPeg.get().startSingleSignOn(matrixClient, loginType, fragmentAfterLogin); }; return ( @@ -36,6 +36,7 @@ const SSOButton = ({matrixClient, loginType, ...props}) => { SSOButton.propTypes = { matrixClient: PropTypes.object.isRequired, // does not use context as may use a temporary client loginType: PropTypes.oneOf(["sso", "cas"]), // defaults to "sso" in base-apis + fragmentAfterLogin: PropTypes.string, }; export default SSOButton; From 52e3c97f8c9a2032fe92b2b4bb5fc68c0f6957b5 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@googlemail.com> Date: Wed, 13 May 2020 06:36:14 +0100 Subject: [PATCH 14/86] Revert "ImageView make clicking off it easier" --- res/css/views/elements/_ImageView.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/css/views/elements/_ImageView.scss b/res/css/views/elements/_ImageView.scss index 983ef074f2..0a4ed2a194 100644 --- a/res/css/views/elements/_ImageView.scss +++ b/res/css/views/elements/_ImageView.scss @@ -37,7 +37,7 @@ limitations under the License. order: 2; /* min-width hack needed for FF */ min-width: 0px; - max-height: 90%; + height: 90%; flex: 15 15 0; display: flex; align-items: center; From 73a6fed1e32594bd7fad4c98684bbc76cbd44978 Mon Sep 17 00:00:00 2001 From: tleydxdy Date: Tue, 12 May 2020 23:11:03 +0000 Subject: [PATCH 15/86] Translated using Weblate (Chinese (Simplified)) Currently translated at 61.7% (1424 of 2307 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/zh_Hans/ --- src/i18n/strings/zh_Hans.json | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/zh_Hans.json b/src/i18n/strings/zh_Hans.json index 4eff773d1c..dc3cc6d176 100644 --- a/src/i18n/strings/zh_Hans.json +++ b/src/i18n/strings/zh_Hans.json @@ -1443,5 +1443,30 @@ "Verifies a user, session, and pubkey tuple": "验证用户、会话和公钥元组", "Unknown (user, session) pair:": "未知(用户、会话)对:", "Session already verified!": "会话已验证!", - "WARNING: Session already verified, but keys do NOT MATCH!": "警告:会话已验证,但密钥不匹配!" + "WARNING: Session already verified, but keys do NOT MATCH!": "警告:会话已验证,但密钥不匹配!", + "WARNING: KEY VERIFICATION FAILED! The signing key for %(userId)s and session %(deviceId)s is \"%(fprint)s\" which does not match the provided key \"%(fingerprint)s\". This could mean your communications are being intercepted!": "警告:密钥验证失败!%(userId)s 的会话 %(deviceId)s 的签名密钥为 %(fprint)s,与提供的密钥 %(fingerprint)s 不符。这可能表示您的通讯已被截获!", + "The signing key you provided matches the signing key you received from %(userId)s's session %(deviceId)s. Session marked as verified.": "您提供的签名密钥与您从 %(userId)s 的会话 %(deviceId)s 获取的一致。该会话被标为已验证。", + "Sends the given message coloured as a rainbow": "以彩虹色发送给定消息", + "Sends the given emote coloured as a rainbow": "以彩虹色发送给定表情符号", + "Displays list of commands with usages and descriptions": "显示指令清单与其描述和用法", + "Displays information about a user": "显示关于用户的信息", + "Send a bug report with logs": "发送带日志的错误报告", + "Opens chat with the given user": "与指定用户发起聊天", + "Sends a message to the given user": "向指定用户发消息", + "%(senderName)s made no change.": "%(senderName)s 未做出变更。", + "%(senderDisplayName)s changed the room name from %(oldRoomName)s to %(newRoomName)s.": "%(senderDisplayName)s 将聊天室名称从 %(oldRoomName)s 改为 %(newRoomName)s。", + "%(senderName)s added the alternative addresses %(addresses)s for this room.|other": "%(senderName)s 为此聊天室添加备用地址 %(addresses)s。", + "%(senderName)s added the alternative addresses %(addresses)s for this room.|one": "%(senderName)s 为此聊天室添加了备用地址 %(addresses)s。", + "%(senderName)s removed the alternative addresses %(addresses)s for this room.|other": "%(senderName)s 为此聊天室移除了备用地址 %(addresses)s。", + "%(senderName)s removed the alternative addresses %(addresses)s for this room.|one": "%(senderName)s 为此聊天室移除了备用地址 %(addresses)s。", + "%(senderName)s changed the alternative addresses for this room.": "%(senderName)s 更改了此聊天室的备用地址。", + "%(senderName)s changed the main and alternative addresses for this room.": "%(senderName)s 更改了此聊天室的主地址与备用地址。", + "%(senderName)s changed the addresses for this room.": "%(senderName)s 更改了此聊天室的地址。", + "%(senderName)s placed a voice call.": "%(senderName)s 发起了语音通话。", + "%(senderName)s placed a voice call. (not supported by this browser)": "%(senderName)s 发起了语音通话。(此浏览器不支持)", + "%(senderName)s placed a video call.": "%(senderName)s 发起了视频通话。", + "%(senderName)s placed a video call. (not supported by this browser)": "%(senderName)s 发起了视频通话。(此浏览器不支持)", + "%(senderName)s removed the rule banning users matching %(glob)s": "%(senderName)s 移除了禁止匹配 %(glob)s 的用户的规则", + "%(senderName)s removed the rule banning servers matching %(glob)s": "%(senderName)s 移除了禁止匹配 %(glob)s 的服务器的规则", + "%(senderName)s removed a ban rule matching %(glob)s": "%(senderName)s 移除了禁止匹配 %(glob)s 的规则" } From 52dec0cc8d871f271f7433036007d015e59f1eb8 Mon Sep 17 00:00:00 2001 From: Jeff Huang Date: Wed, 13 May 2020 03:42:53 +0000 Subject: [PATCH 16/86] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (2307 of 2307 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/zh_Hant/ --- src/i18n/strings/zh_Hant.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/zh_Hant.json b/src/i18n/strings/zh_Hant.json index ba8ffa0fcb..257b245e1c 100644 --- a/src/i18n/strings/zh_Hant.json +++ b/src/i18n/strings/zh_Hant.json @@ -2421,5 +2421,9 @@ "Verify your other session using one of the options below.": "使用下方的其中一個選項來驗證您其他的工作階段。", "Invite someone using their name, username (like ), email address or share this room.": "使用某人的名字、使用者名稱(如 )、電子郵件地址或分享此聊天室來邀請他們。", "Message deleted": "訊息已刪除", - "Message deleted by %(name)s": "訊息已被 %(name)s 刪除" + "Message deleted by %(name)s": "訊息已被 %(name)s 刪除", + "Opens chat with the given user": "開啟與指定使用者的聊天", + "Sends a message to the given user": "傳送訊息給指定的使用者", + "Waiting for your other session to verify…": "正在等待您的其他工作階段進行驗證……", + "You've successfully verified your device!": "您已成功驗證您的裝置!" } From 42eb36d6287d0bc0c3ffd3e51f3292b83c9cd397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanislav=20Luke=C5=A1?= Date: Tue, 12 May 2020 17:30:23 +0000 Subject: [PATCH 17/86] Translated using Weblate (Czech) Currently translated at 95.2% (2197 of 2307 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/cs/ --- src/i18n/strings/cs.json | 45 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/cs.json b/src/i18n/strings/cs.json index d08ac6c0f5..3b018204c0 100644 --- a/src/i18n/strings/cs.json +++ b/src/i18n/strings/cs.json @@ -2246,5 +2246,48 @@ "Command failed": "Příkaz selhal", "Could not find user in room": "Nepovedlo se najít uživatele v místnosti", "Please supply a widget URL or embed code": "Zadejte prosím URL widgetu nebo jeho kód", - "Send a bug report with logs": "Zaslat hlášení o chybě" + "Send a bug report with logs": "Zaslat hlášení o chybě", + "You signed in to a new session without verifying it:": "Přihlásili jste se do nové relace, ale neoveřili jste ji:", + "Verify your other session using one of the options below.": "Ověřte ostatní relací jedním z následujících způsobů.", + "Enable cross-signing to verify per-user instead of per-session": "Povolit cross-signing - ověřování uživatelů místo oveřování jednotlivých relací", + "Keep recovery passphrase in memory for this session": "V této relaci si heslo pro obnovení zálohy zapamatovat", + "Click the button below to confirm deleting these sessions.|other": "Zmáčknutím tlačítka potvrdíte smazání těchto relací.", + "Click the button below to confirm deleting these sessions.|one": "Zmáčknutím tlačítka potvrdíte smazání této relace.", + "Delete sessions|other": "Smazat relace", + "Delete sessions|one": "Smazat relaci", + "Where you’re logged in": "Kde jste přihlášení", + "You've successfully verified your device!": "Úspěšně jste ověřili vaše zařízení!", + "Start verification again from the notification.": "Začít proces ověření znovu pomocí notifikace.", + "Start verification again from their profile.": "Začít proces ověření znovu z jejich profilu.", + "Verification timed out.": "Ověření vypršelo.", + "You cancelled verification on your other session.": "Na druhé relace jste proces ověření zrušili.", + "%(displayName)s cancelled verification.": "%(displayName)s zrušil/a proces ověření.", + "You cancelled verification.": "Zrušili jste proces ověření.", + "Message deleted": "Zpráva smazána", + "Message deleted by %(name)s": "Zpráva smazána uživatelem %(name)s", + "Can't load this message": "Tuto zprávu nelze načíst", + "Submit logs": "Odeslat záznamy o chybě", + "Looks good": "To vypadá dobře", + "Can't find this server or its room list": "Server nebo jeho seznam místností se nepovedlo nalézt", + "All rooms": "Všechny místnosti", + "Your server": "Váš server", + "Are you sure you want to remove %(serverName)s": "Opravdu chcete odstranit %(serverName)s", + "Remove server": "Odstranit server", + "Matrix": "Matrix", + "Add a new server": "Přidat nový server", + "Enter the name of a new server you want to explore.": "Zadejte jméno serveru, který si chcete prohlédnout.", + "Server name": "Jméno serveru", + "Add a new server...": "Přidat nový server...", + "%(networkName)s rooms": "místnosti v %(networkName)s", + "Matrix rooms": "místnosti na Matrixu", + "Reminder: Your browser is unsupported, so your experience may be unpredictable.": "Připomínka: Váš prohlížeč není oficiálně podporován, tak se může Riot chovat nepředvídatelně.", + "Enable end-to-end encryption": "Povolit E2E šifrování", + "You can’t disable this later. Bridges & most bots won’t work yet.": "Už to v budoucnu nepůjde vypnout. Většina botů a propojení zatím nefunguje.", + "Server did not require any authentication": "Server nevyžadoval žádné ověření", + "Server did not return valid authentication information.": "Server neposkytl platné informace o ověření.", + "Confirm your account deactivation by using Single Sign On to prove your identity.": "Potvrďte deaktivaci účtu použtím Jednotného přihlášení.", + "Are you sure you want to deactivate your account? This is irreversible.": "Opravdu chcete deaktivovat účet? Je to nevratné.", + "Confirm account deactivation": "Potvrďte deaktivaci účtu", + "There was a problem communicating with the server. Please try again.": "Došlo k potížím při komunikaci se serverem. Zkuste to prosím znovu.", + "Start a conversation with someone using their name, username (like ) or email address.": "Začněte s někým konverzovat za pomocí jména, přihlašovacího jména (jako ) nebo emailu." } From 1cfdf7e56fc3b2f3a4efc8867c8906d3731541b4 Mon Sep 17 00:00:00 2001 From: Tirifto Date: Tue, 12 May 2020 17:22:31 +0000 Subject: [PATCH 18/86] Translated using Weblate (Esperanto) Currently translated at 100.0% (2307 of 2307 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/eo/ --- src/i18n/strings/eo.json | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/i18n/strings/eo.json b/src/i18n/strings/eo.json index 4d270260fc..9e8641a6e9 100644 --- a/src/i18n/strings/eo.json +++ b/src/i18n/strings/eo.json @@ -70,7 +70,7 @@ "Unable to create widget.": "Ne povas krei fenestraĵon.", "Failed to send request.": "Malsukcesis sendi peton.", "This room is not recognised.": "Ĉi tiu ĉambro ne estas rekonita.", - "Power level must be positive integer.": "Nivelo de potenco devas esti entjero pozitiva.", + "Power level must be positive integer.": "Povnivelo devas esti entjero pozitiva.", "You are not in this room.": "Vi ne estas en tiu ĉi ĉambro.", "You do not have permission to do that in this room.": "Vi ne havas permeson fari tion en tiu ĉambro.", "Missing room_id in request": "En peto mankas room_id", @@ -122,7 +122,7 @@ "%(senderName)s made future room history visible to anyone.": "%(senderName)s videbligis estontan historion de la ĉambro al ĉiuj.", "%(senderName)s made future room history visible to unknown (%(visibility)s).": "%(senderName)s videbligis estontan historion de la ĉambro al nekonata (%(visibility)s).", "%(userId)s from %(fromPowerLevel)s to %(toPowerLevel)s": "%(userId)s de %(fromPowerLevel)s al %(toPowerLevel)s", - "%(senderName)s changed the power level of %(powerLevelDiffText)s.": "%(senderName)s ŝanĝis la potencan nivelon de %(powerLevelDiffText)s.", + "%(senderName)s changed the power level of %(powerLevelDiffText)s.": "%(senderName)s ŝanĝis la povnivelon de %(powerLevelDiffText)s.", "%(senderName)s changed the pinned messages for the room.": "%(senderName)s ŝanĝis la fiksitajn mesaĝojn de la ĉambro.", "%(widgetName)s widget modified by %(senderName)s": "Fenestraĵon %(widgetName)s ŝanĝis %(senderName)s", "%(widgetName)s widget added by %(senderName)s": "Fenestraĵon %(widgetName)s aldonis %(senderName)s", @@ -212,8 +212,8 @@ "Failed to ban user": "Malsukcesis forbari uzanton", "Failed to mute user": "Malsukcesis silentigi uzanton", "Failed to toggle moderator status": "Malsukcesis baskuligi estrecon", - "Failed to change power level": "Malsukcesis ŝanĝi nivelon de potenco", - "You will not be able to undo this change as you are promoting the user to have the same power level as yourself.": "Tiun ĉi ŝanĝon vi ne povos fareblos, ĉar vi donas al la uzanto la saman nivelon de potenco, kiun havas vi mem.", + "Failed to change power level": "Malsukcesis ŝanĝi povnivelon", + "You will not be able to undo this change as you are promoting the user to have the same power level as yourself.": "Tiun ĉi ŝanĝon vi ne povos malfari, ĉar vi donas al la uzanto la saman povnivelon, kiun havas vi mem.", "Are you sure?": "Ĉu vi certas?", "Unignore": "Reatenti", "Ignore": "Malatenti", @@ -233,7 +233,7 @@ "and %(count)s others...|one": "kaj unu alia…", "Invited": "Invititaj", "Filter room members": "Filtri ĉambranojn", - "%(userName)s (power %(powerLevelNumber)s)": "%(userName)s (potenco je %(powerLevelNumber)s)", + "%(userName)s (power %(powerLevelNumber)s)": "%(userName)s (povnivelo je %(powerLevelNumber)s)", "Attachment": "Aldonaĵo", "Hangup": "Fini vokon", "Voice call": "Voĉvoko", @@ -275,7 +275,7 @@ "Search": "Serĉi", "Community Invites": "Komunumaj invitoj", "Invites": "Invitoj", - "Favourites": "Ŝatataj", + "Favourites": "Elstarigitaj", "Rooms": "Ĉambroj", "Low priority": "Malpli gravaj", "Historical": "Estintaj", @@ -291,7 +291,7 @@ "Banned users": "Forbaritaj uzantoj", "This room is not accessible by remote Matrix servers": "Ĉi tiu ĉambro ne atingeblas por foraj serviloj de Matrix", "Leave room": "Eliri ĉambron", - "Favourite": "Ŝatata", + "Favourite": "Elstarigi", "Guests cannot join this room even if explicitly invited.": "Gastoj ne povas aliĝi ĉi tiun ĉambron eĉ kun malimplica invito.", "Click here to fix": "Klaku ĉi tie por riparo", "Who can access this room?": "Kiu povas aliri ĉi tiun ĉambron?", @@ -509,7 +509,7 @@ "Failed to remove the room from the summary of %(groupId)s": "Malsukcesis forigi la ĉambron de la superrigardo de %(groupId)s", "The room '%(roomName)s' could not be removed from the summary.": "Ĉambro ;%(roomName)s' ne forigeblas de la superrigardo.", "Add users to the community summary": "Aldoni uzantojn al la komunuma superrigardo", - "Who would you like to add to this summary?": "Kiun vi ŝatus aldoni al tiu ĉi superrigardo?", + "Who would you like to add to this summary?": "Kiun vi volas aldoni al tiu ĉi superrigardo?", "Failed to add the following users to the summary of %(groupId)s:": "Malsukcesis aldoni la jenajn uzantojn al la superrigardo de %(groupId)s:", "Add a User": "Aldoni uzanton", "Failed to remove a user from the summary of %(groupId)s": "Malsukcesis forigi uzanton de la superrigardo de %(groupId)s", @@ -550,7 +550,7 @@ "Connectivity to the server has been lost.": "Konekto al la servilo perdiĝis.", "Sent messages will be stored until your connection has returned.": "Senditaj mesaĝoj konserviĝos ĝis via konekto refunkcios.", "Active call": "Aktiva voko", - "There's no one else here! Would you like to invite others or stop warning about the empty room?": "Neniu alia ĉeestas! Ĉu vi ŝatus inviti aliajnĉesigi avertadon pri la malplena ĉambro?", + "There's no one else here! Would you like to invite others or stop warning about the empty room?": "Neniu alia ĉeestas! Ĉu vi volas inviti aliajnĉesigi avertadon pri la malplena ĉambro?", "You seem to be uploading files, are you sure you want to quit?": "Ŝajne vi alŝutas dosierojn nun; ĉu vi tamen volas foriri?", "You seem to be in a call, are you sure you want to quit?": "Ŝajne vi vokas nun; ĉu vi tamen volas foriri?", "Search failed": "Serĉo malsukcesis", @@ -621,7 +621,7 @@ "This server does not support authentication with a phone number.": "Ĉi tiu servilo ne subtenas aŭtentikigon per telefona numero.", "Displays action": "Montras agon", "Bans user with given id": "Forbaras uzanton kun la donita identigilo", - "Define the power level of a user": "Difini la potencan nivelon de uzanto", + "Define the power level of a user": "Difini la povnivelon de uzanto", "Deops user with given id": "Senestrigas uzanton kun donita identigilo", "Invites user with given id to current room": "Invitas uzanton per identigilo al la nuna ĉambro", "Joins room with given alias": "Aliĝas al ĉambro per kromnomo", @@ -1477,7 +1477,7 @@ "Demote yourself?": "Ĉu malrangaltigi vin mem?", "You will not be able to undo this change as you are demoting yourself, if you are the last privileged user in the room it will be impossible to regain privileges.": "Vi ne povos malfari tiun ŝanĝon, ĉar vi malrangaltigas vin mem; se vi estas la lasta povohava uzanto en la ĉambro, estos neeble vian povon rehavi.", "Demote": "Malrangaltigi", - "Power level": "Povonivelo", + "Power level": "Povnivelo", "Use two-way text verification": "Uzi duflankan tekstan kontrolon", "Upgrading this room requires closing down the current instance of the room and creating a new room in its place. To give room members the best possible experience, we will:": "Gradaltigo de ĉi tiu ĉambro bezonas fermi ĝin, kaj krei novan por anstataŭi ĝin. Por plejbonigi sperton de la ĉambranoj, ni:", "Invalid homeserver discovery response": "Nevalida eltrova respondo de hejmservilo", @@ -1571,10 +1571,10 @@ "Always show the window menu bar": "Ĉiam montri la fenestran menubreton", "Upgrade the room": "Gradaltigi la ĉambron", "Enable room encryption": "Ŝalti ĉifradon de la ĉambro", - "Error changing power level requirement": "Eraris ŝanĝo de postulo de potenconivelo", - "An error occurred changing the room's power level requirements. Ensure you have sufficient permissions and try again.": "Eraris ŝanĝo de la postuloj de la ĉambro pri potenconivelo. Certigu, ke vi havas sufiĉajn permesojn, kaj reprovu.", - "Error changing power level": "Eraris ŝanĝo de potenconivelo", - "An error occurred changing the user's power level. Ensure you have sufficient permissions and try again.": "Eraris ŝanĝo de potenconivelo de la uzanto. Certigu, ke vi havas sufiĉajn permesojn, kaj reprovu.", + "Error changing power level requirement": "Eraris ŝanĝo de postulo de povnivelo", + "An error occurred changing the room's power level requirements. Ensure you have sufficient permissions and try again.": "Eraris ŝanĝo de la postuloj de la ĉambro pri povnivelo. Certigu, ke vi havas sufiĉajn permesojn, kaj reprovu.", + "Error changing power level": "Eraris ŝanĝo de povnivelo", + "An error occurred changing the user's power level. Ensure you have sufficient permissions and try again.": "Eraris ŝanĝo de povnivelo de la uzanto. Certigu, ke vi havas sufiĉajn permesojn, kaj reprovu.", "Remove %(email)s?": "Ĉu forigi %(email)s?", "Remove %(phone)s?": "Ĉu forigi %(phone)s?", "No recent messages by %(user)s found": "Neniuj freŝaj mesaĝoj de %(user)s troviĝis", @@ -1965,7 +1965,7 @@ "Use an Integration Manager (%(serverName)s) to manage bots, widgets, and sticker packs.": "Uzu kunigilon (%(serverName)s) por administrado de robotoj, fenestraĵoj, kaj glumarkaroj.", "Use an Integration Manager to manage bots, widgets, and sticker packs.": "Uzu kunigilon por administrado de robotoj, fenestraĵoj, kaj glumarkaroj.", "Manage integrations": "Administri kunigojn", - "Integration Managers receive configuration data, and can modify widgets, send room invites, and set power levels on your behalf.": "Kunigiloj ricevas agordajn datumojn, kaj povas modifi fenestraĵojn, sendi invitojn al ĉambroj, kaj vianome agordi nivelojn de potenco.", + "Integration Managers receive configuration data, and can modify widgets, send room invites, and set power levels on your behalf.": "Kunigiloj ricevas agordajn datumojn, kaj povas modifi fenestraĵojn, sendi invitojn al ĉambroj, kaj vianome agordi povnivelojn.", "Your password was successfully changed. You will not receive push notifications on other sessions until you log back in to them": "Via pasvorto sukcese ŝanĝiĝis. Vi ne ricevados pasivajn sciigojn en aliaj salutaĵoj, ĝis vi ilin resalutos", "Error downloading theme information.": "Eraris elŝuto de informoj pri haŭto.", "Theme added!": "Haŭto aldoniĝis!", @@ -2396,5 +2396,9 @@ "Cancel replying to a message": "Nuligi respondon al mesaĝo", "Invite someone using their name, username (like ), email address or share this room.": "Invitu iun per ĝia nomo, uzantonomo (kiel ), retpoŝtadreso, aŭ kunhavigu la ĉambron.", "Message deleted": "Mesaĝo foriĝis", - "Message deleted by %(name)s": "Mesaĝon forigis %(name)s" + "Message deleted by %(name)s": "Mesaĝon forigis %(name)s", + "Opens chat with the given user": "Malfermas babilon kun la uzanto", + "Sends a message to the given user": "Sendas mesaĝon al la uzanto", + "Waiting for your other session to verify…": "Atendante kontrolon de via alia salutaĵo…", + "You've successfully verified your device!": "Vi sukcese kontrolis vian aparaton!" } From cad0f38d4d147e88ecfb5d2dc26d33c98e22740f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Priit=20J=C3=B5er=C3=BC=C3=BCt?= Date: Tue, 12 May 2020 21:37:12 +0000 Subject: [PATCH 19/86] Translated using Weblate (Estonian) Currently translated at 45.0% (1037 of 2307 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/et/ --- src/i18n/strings/et.json | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/et.json b/src/i18n/strings/et.json index 95096a080d..cda3a5e76d 100644 --- a/src/i18n/strings/et.json +++ b/src/i18n/strings/et.json @@ -1026,5 +1026,18 @@ "Ed25519 fingerprint": "Ed25519 sõrmejälg", "User ID": "Kasutajatunnus", "Algorithm": "Algoritm", - "unencrypted": "krüptimata" + "unencrypted": "krüptimata", + "Terms and Conditions": "Kasutustingimused", + "Logout": "Logi välja", + "Your Communities": "Sinu kogukonnad", + "Error whilst fetching joined communities": "Viga nende kogukondade laadimisel, millega sa oled liitunud", + "You have no visible notifications": "Sul ei ole nähtavaid teavitusi", + "Riot failed to get the protocol list from the homeserver. The homeserver may be too old to support third party networks.": "Riot'il ei õnnestunud koduserverist laadida toetatud protokollide loendit. Toetamaks kolmandate osapoolte võrke võib koduserver olla liiga vana.", + "Riot failed to get the public room list.": "Riot'il ei õnnestunud laadida avalike jututubade loendit.", + "The homeserver may be unavailable or overloaded.": "Koduserver pole kas saadaval või on üle koormatud.", + "Room not found": "Jututuba ei leidunud", + "Preview": "Eelvaade", + "View": "Näita", + "Message not sent due to unknown sessions being present": "Sõnum on saatmata, sest jutuoas on tundmatud sessioonid", + "You can't send any messages until you review and agree to our terms and conditions.": "Sa ei saa saata ühtego sõnumit enne, kui oled läbi lugenud ja nõustunud meie kasutustingimustega." } From be61968dcaa3b1f0b30581a98e8dbfd55738fcbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20C?= Date: Wed, 13 May 2020 07:19:39 +0000 Subject: [PATCH 20/86] Translated using Weblate (French) Currently translated at 100.0% (2307 of 2307 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/fr/ --- src/i18n/strings/fr.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/fr.json b/src/i18n/strings/fr.json index 1756ff57ad..7546385bf6 100644 --- a/src/i18n/strings/fr.json +++ b/src/i18n/strings/fr.json @@ -2422,5 +2422,9 @@ "Verify your other session using one of the options below.": "Vérifiez votre autre session en utilisant une des options ci-dessous.", "Invite someone using their name, username (like ), email address or share this room.": "Invitez quelqu’un en utilisant leur nom, leur nom d’utilisateur (comme ), leur adresse e-mail ou partagez ce salon.", "Message deleted": "Message supprimé", - "Message deleted by %(name)s": "Message supprimé par %(name)s" + "Message deleted by %(name)s": "Message supprimé par %(name)s", + "Opens chat with the given user": "Ouvre une discussion avec l’utilisateur fourni", + "Sends a message to the given user": "Envoie un message à l’utilisateur fourni", + "Waiting for your other session to verify…": "En attente de la vérification depuis votre autre session…", + "You've successfully verified your device!": "Vous avez bien vérifié votre appareil !" } From d11923e2e3d3f4189d8848349f0ec1073ea8f91e Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 13 May 2020 10:38:32 +0100 Subject: [PATCH 21/86] Add new keyboard shortcuts for jump to unread and upload file Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/accessibility/KeyboardShortcuts.tsx | 41 +++++++++++++++---- src/components/structures/RoomView.js | 14 ++++++- src/components/views/rooms/MessageComposer.js | 13 +++++- 3 files changed, 57 insertions(+), 11 deletions(-) diff --git a/src/accessibility/KeyboardShortcuts.tsx b/src/accessibility/KeyboardShortcuts.tsx index bcbf3d6810..f527ab4a14 100644 --- a/src/accessibility/KeyboardShortcuts.tsx +++ b/src/accessibility/KeyboardShortcuts.tsx @@ -34,6 +34,7 @@ export enum Categories { CALLS = "Calls", COMPOSER = "Composer", ROOM_LIST = "Room List", + ROOM = "Room", AUTOCOMPLETE = "Autocomplete", } @@ -142,6 +143,34 @@ const shortcuts: Record = { }, ], + [Categories.ROOM]: [ + { + keybinds: [{ + key: Key.PAGE_UP, + }, { + key: Key.PAGE_DOWN, + }], + description: _td("Scroll up/down in the timeline"), + }, { + keybinds: [{ + key: Key.ESCAPE, + }], + description: _td("Dismiss read marker and jump to bottom"), + }, { + keybinds: [{ + modifiers: [Modifiers.SHIFT], + key: Key.PAGE_UP, + }], + description: _td("Jump to oldest unread message"), + }, { + keybinds: [{ + modifiers: [CMD_OR_CTRL, Modifiers.SHIFT], + key: Key.U, + }], + description: _td("Upload a file"), + } + ], + [Categories.ROOM_LIST]: [ { keybinds: [{ @@ -181,13 +210,6 @@ const shortcuts: Record = { [Categories.NAVIGATION]: [ { - keybinds: [{ - key: Key.PAGE_UP, - }, { - key: Key.PAGE_DOWN, - }], - description: _td("Scroll up/down in the timeline"), - }, { keybinds: [{ modifiers: [Modifiers.ALT, Modifiers.SHIFT], key: Key.ARROW_UP, @@ -257,10 +279,11 @@ const shortcuts: Record = { const categoryOrder = [ Categories.COMPOSER, - Categories.CALLS, - Categories.ROOM_LIST, Categories.AUTOCOMPLETE, + Categories.ROOM, + Categories.ROOM_LIST, Categories.NAVIGATION, + Categories.CALLS, ]; interface IModal { diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index f53929df4a..e413c33efa 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -41,7 +41,7 @@ import * as ObjectUtils from '../../ObjectUtils'; import * as Rooms from '../../Rooms'; import eventSearch from '../../Searching'; -import {isOnlyCtrlOrCmdKeyEvent, Key} from '../../Keyboard'; +import {isOnlyCtrlOrCmdIgnoreShiftKeyEvent, isOnlyCtrlOrCmdKeyEvent, Key} from '../../Keyboard'; import MainSplit from './MainSplit'; import RightPanel from './RightPanel'; @@ -588,6 +588,18 @@ export default createReactClass({ handled = true; } break; + case Key.PAGE_UP: + if (!ev.altKey && !ev.ctrlKey && ev.shiftKey && !ev.metaKey) { + this.jumpToReadMarker(); + handled = true; + } + break; + case Key.U.toUpperCase(): + if (isOnlyCtrlOrCmdIgnoreShiftKeyEvent(ev) && ev.shiftKey) { + dis.dispatch({ action: "upload_file" }) + handled = true; + } + break; } if (handled) { diff --git a/src/components/views/rooms/MessageComposer.js b/src/components/views/rooms/MessageComposer.js index 4749742a7d..1142e91057 100644 --- a/src/components/views/rooms/MessageComposer.js +++ b/src/components/views/rooms/MessageComposer.js @@ -114,8 +114,19 @@ class UploadButton extends React.Component { this.onUploadFileInputChange = this.onUploadFileInputChange.bind(this); this._uploadInput = createRef(); + this._dispatcherRef = dis.register(this.onAction); } + componentWillUnmount() { + dis.unregister(this._dispatcherRef); + } + + onAction = payload => { + if (payload.action === "upload_file") { + this.onUploadClick(); + } + }; + onUploadClick(ev) { if (MatrixClientPeg.get().isGuest()) { dis.dispatch({action: 'require_registration'}); @@ -128,7 +139,7 @@ class UploadButton extends React.Component { if (ev.target.files.length === 0) return; // take a copy so we can safely reset the value of the form control - // (Note it is a FileList: we can't use slice or sesnible iteration). + // (Note it is a FileList: we can't use slice or sensible iteration). const tfiles = []; for (let i = 0; i < ev.target.files.length; ++i) { tfiles.push(ev.target.files[i]); From 0e05e6db86467c730b853c8f8d7009f2a28d8e85 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 13 May 2020 10:40:23 +0100 Subject: [PATCH 22/86] i18n Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/i18n/strings/en_EN.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index b2fe409aa5..d469103897 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -2284,13 +2284,16 @@ "Cancel replying to a message": "Cancel replying to a message", "Toggle microphone mute": "Toggle microphone mute", "Toggle video on/off": "Toggle video on/off", + "Scroll up/down in the timeline": "Scroll up/down in the timeline", + "Dismiss read marker and jump to bottom": "Dismiss read marker and jump to bottom", + "Jump to oldest unread message": "Jump to oldest unread message", + "Upload a file": "Upload a file", "Jump to room search": "Jump to room search", "Navigate up/down in the room list": "Navigate up/down in the room list", "Select room from the room list": "Select room from the room list", "Collapse room list section": "Collapse room list section", "Expand room list section": "Expand room list section", "Clear room list filter field": "Clear room list filter field", - "Scroll up/down in the timeline": "Scroll up/down in the timeline", "Previous/next unread room or DM": "Previous/next unread room or DM", "Previous/next room or DM": "Previous/next room or DM", "Toggle the top left menu": "Toggle the top left menu", From 51f59c6c327873bd796eab6bdd91f20c854a66a1 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 13 May 2020 11:40:56 +0100 Subject: [PATCH 23/86] UserView, show Welcome page in the mid panel instead of empty space Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/UserView.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/structures/UserView.js b/src/components/structures/UserView.js index 493cc136d1..694592af88 100644 --- a/src/components/structures/UserView.js +++ b/src/components/structures/UserView.js @@ -22,6 +22,7 @@ import {MatrixClientPeg} from "../../MatrixClientPeg"; import * as sdk from "../../index"; import Modal from '../../Modal'; import { _t } from '../../languageHandler'; +import HomePage from "./HomePage"; export default class UserView extends React.Component { static get propTypes() { @@ -79,7 +80,7 @@ export default class UserView extends React.Component { const RightPanel = sdk.getComponent('structures.RightPanel'); const MainSplit = sdk.getComponent('structures.MainSplit'); const panel = ; - return (
); + return (); } else { return (
); } From 226e4b297a7c79923b0466b2a82ff2c91d87d5bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanislav=20Luke=C5=A1?= Date: Wed, 13 May 2020 18:22:38 +0000 Subject: [PATCH 24/86] Translated using Weblate (Czech) Currently translated at 95.4% (2201 of 2307 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/cs/ --- src/i18n/strings/cs.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/cs.json b/src/i18n/strings/cs.json index 3b018204c0..181a692b73 100644 --- a/src/i18n/strings/cs.json +++ b/src/i18n/strings/cs.json @@ -2289,5 +2289,9 @@ "Are you sure you want to deactivate your account? This is irreversible.": "Opravdu chcete deaktivovat účet? Je to nevratné.", "Confirm account deactivation": "Potvrďte deaktivaci účtu", "There was a problem communicating with the server. Please try again.": "Došlo k potížím při komunikaci se serverem. Zkuste to prosím znovu.", - "Start a conversation with someone using their name, username (like ) or email address.": "Začněte s někým konverzovat za pomocí jména, přihlašovacího jména (jako ) nebo emailu." + "Start a conversation with someone using their name, username (like ) or email address.": "Začněte s někým konverzovat za pomocí jména, přihlašovacího jména (jako ) nebo emailu.", + "Opens chat with the given user": "Otevře konverzaci s tímto uživatelem", + "Sends a message to the given user": "Pošle zprávu danému uživateli", + "Waiting for your other session to verify…": "Čekáme na ověření od vaší druhé relace…", + "Verify all your sessions to ensure your account & messages are safe": "Ověřte všechny své relace, abyste zaručili, že jsou vaše zprávy a účet bezpečné" } From fa83df4bde7b317737a27a8cb24d2b44aa633750 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 13 May 2020 21:07:29 -0600 Subject: [PATCH 25/86] Convert dispatcher to TypeScript and replace async usage with new class Due to TypeScript and flux's types being annoying and highly typesafe, we need an AsyncActionPayload which intentionally doesn't use the 'action' property. This looks a bit awkward, though for the rare cases we do actually fire async actions it should be fine enough. The call signature changes slightly for async events, therefore this commit also updates its usages for async events. The `fire()` function is to be used in a future commit. Remove biased comment --- package.json | 1 + src/actions/RoomListActions.js | 145 ----------------- src/actions/RoomListActions.ts | 151 ++++++++++++++++++ src/actions/TagOrderActions.js | 109 ------------- src/actions/TagOrderActions.ts | 112 +++++++++++++ .../{actionCreators.js => actionCreators.ts} | 14 +- src/dispatcher.js | 58 ------- src/dispatcher.ts | 121 ++++++++++++++ tsconfig.json | 3 +- yarn.lock | 21 +++ 10 files changed, 417 insertions(+), 318 deletions(-) delete mode 100644 src/actions/RoomListActions.js create mode 100644 src/actions/RoomListActions.ts delete mode 100644 src/actions/TagOrderActions.js create mode 100644 src/actions/TagOrderActions.ts rename src/actions/{actionCreators.js => actionCreators.ts} (80%) delete mode 100644 src/dispatcher.js create mode 100644 src/dispatcher.ts diff --git a/package.json b/package.json index 92d228a812..2258d5e3b6 100644 --- a/package.json +++ b/package.json @@ -118,6 +118,7 @@ "@babel/register": "^7.7.4", "@peculiar/webcrypto": "^1.0.22", "@types/classnames": "^2.2.10", + "@types/flux": "^3.1.9", "@types/modernizr": "^3.5.3", "@types/react": "16.9", "babel-eslint": "^10.0.3", diff --git a/src/actions/RoomListActions.js b/src/actions/RoomListActions.js deleted file mode 100644 index 10a3848dda..0000000000 --- a/src/actions/RoomListActions.js +++ /dev/null @@ -1,145 +0,0 @@ -/* -Copyright 2018 New Vector Ltd - -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 { asyncAction } from './actionCreators'; -import RoomListStore, {TAG_DM} from '../stores/RoomListStore'; -import Modal from '../Modal'; -import * as Rooms from '../Rooms'; -import { _t } from '../languageHandler'; -import * as sdk from '../index'; - -const RoomListActions = {}; - -/** - * Creates an action thunk that will do an asynchronous request to - * tag room. - * - * @param {MatrixClient} matrixClient the matrix client to set the - * account data on. - * @param {Room} room the room to tag. - * @param {string} oldTag the tag to remove (unless oldTag ==== newTag) - * @param {string} newTag the tag with which to tag the room. - * @param {?number} oldIndex the previous position of the room in the - * list of rooms. - * @param {?number} newIndex the new position of the room in the list - * of rooms. - * @returns {function} an action thunk. - * @see asyncAction - */ -RoomListActions.tagRoom = function(matrixClient, room, oldTag, newTag, oldIndex, newIndex) { - let metaData = null; - - // Is the tag ordered manually? - if (newTag && !newTag.match(/^(m\.lowpriority|im\.vector\.fake\.(invite|recent|direct|archived))$/)) { - const lists = RoomListStore.getRoomLists(); - const newList = [...lists[newTag]]; - - newList.sort((a, b) => a.tags[newTag].order - b.tags[newTag].order); - - // If the room was moved "down" (increasing index) in the same list we - // need to use the orders of the tiles with indices shifted by +1 - const offset = ( - newTag === oldTag && oldIndex < newIndex - ) ? 1 : 0; - - const indexBefore = offset + newIndex - 1; - const indexAfter = offset + newIndex; - - const prevOrder = indexBefore <= 0 ? - 0 : newList[indexBefore].tags[newTag].order; - const nextOrder = indexAfter >= newList.length ? - 1 : newList[indexAfter].tags[newTag].order; - - metaData = { - order: (prevOrder + nextOrder) / 2.0, - }; - } - - return asyncAction('RoomListActions.tagRoom', () => { - const promises = []; - const roomId = room.roomId; - - // Evil hack to get DMs behaving - if ((oldTag === undefined && newTag === TAG_DM) || - (oldTag === TAG_DM && newTag === undefined) - ) { - return Rooms.guessAndSetDMRoom( - room, newTag === TAG_DM, - ).catch((err) => { - const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); - console.error("Failed to set direct chat tag " + err); - Modal.createTrackedDialog('Failed to set direct chat tag', '', ErrorDialog, { - title: _t('Failed to set direct chat tag'), - description: ((err && err.message) ? err.message : _t('Operation failed')), - }); - }); - } - - const hasChangedSubLists = oldTag !== newTag; - - // More evilness: We will still be dealing with moving to favourites/low prio, - // but we avoid ever doing a request with TAG_DM. - // - // if we moved lists, remove the old tag - if (oldTag && oldTag !== TAG_DM && - hasChangedSubLists - ) { - const promiseToDelete = matrixClient.deleteRoomTag( - roomId, oldTag, - ).catch(function(err) { - const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); - console.error("Failed to remove tag " + oldTag + " from room: " + err); - Modal.createTrackedDialog('Failed to remove tag from room', '', ErrorDialog, { - title: _t('Failed to remove tag %(tagName)s from room', {tagName: oldTag}), - description: ((err && err.message) ? err.message : _t('Operation failed')), - }); - }); - - promises.push(promiseToDelete); - } - - // if we moved lists or the ordering changed, add the new tag - if (newTag && newTag !== TAG_DM && - (hasChangedSubLists || metaData) - ) { - // metaData is the body of the PUT to set the tag, so it must - // at least be an empty object. - metaData = metaData || {}; - - const promiseToAdd = matrixClient.setRoomTag(roomId, newTag, metaData).catch(function(err) { - const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); - console.error("Failed to add tag " + newTag + " to room: " + err); - Modal.createTrackedDialog('Failed to add tag to room', '', ErrorDialog, { - title: _t('Failed to add tag %(tagName)s to room', {tagName: newTag}), - description: ((err && err.message) ? err.message : _t('Operation failed')), - }); - - throw err; - }); - - promises.push(promiseToAdd); - } - - return Promise.all(promises); - }, () => { - // For an optimistic update - return { - room, oldTag, newTag, metaData, - }; - }); -}; - -export default RoomListActions; diff --git a/src/actions/RoomListActions.ts b/src/actions/RoomListActions.ts new file mode 100644 index 0000000000..8ad3ad0781 --- /dev/null +++ b/src/actions/RoomListActions.ts @@ -0,0 +1,151 @@ +/* +Copyright 2018 New Vector Ltd +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 { asyncAction } from './actionCreators'; +import RoomListStore, { TAG_DM } from '../stores/RoomListStore'; +import Modal from '../Modal'; +import * as Rooms from '../Rooms'; +import { _t } from '../languageHandler'; +import * as sdk from '../index'; +import { MatrixClient } from "matrix-js-sdk/src/client"; +import { Room } from "matrix-js-sdk/src/models/room"; +import { AsyncActionPayload } from "../dispatcher"; + +export default class RoomListActions { + /** + * Creates an action thunk that will do an asynchronous request to + * tag room. + * + * @param {MatrixClient} matrixClient the matrix client to set the + * account data on. + * @param {Room} room the room to tag. + * @param {string} oldTag the tag to remove (unless oldTag ==== newTag) + * @param {string} newTag the tag with which to tag the room. + * @param {?number} oldIndex the previous position of the room in the + * list of rooms. + * @param {?number} newIndex the new position of the room in the list + * of rooms. + * @returns {AsyncActionPayload} an async action payload + * @see asyncAction + */ + public static tagRoom( + matrixClient: MatrixClient, room: Room, + oldTag: string, newTag: string, + oldIndex: number | null, newIndex: number | null, + ): AsyncActionPayload { + let metaData = null; + + // Is the tag ordered manually? + if (newTag && !newTag.match(/^(m\.lowpriority|im\.vector\.fake\.(invite|recent|direct|archived))$/)) { + const lists = RoomListStore.getRoomLists(); + const newList = [...lists[newTag]]; + + newList.sort((a, b) => a.tags[newTag].order - b.tags[newTag].order); + + // If the room was moved "down" (increasing index) in the same list we + // need to use the orders of the tiles with indices shifted by +1 + const offset = ( + newTag === oldTag && oldIndex < newIndex + ) ? 1 : 0; + + const indexBefore = offset + newIndex - 1; + const indexAfter = offset + newIndex; + + const prevOrder = indexBefore <= 0 ? + 0 : newList[indexBefore].tags[newTag].order; + const nextOrder = indexAfter >= newList.length ? + 1 : newList[indexAfter].tags[newTag].order; + + metaData = { + order: (prevOrder + nextOrder) / 2.0, + }; + } + + return asyncAction('RoomListActions.tagRoom', () => { + const promises = []; + const roomId = room.roomId; + + // Evil hack to get DMs behaving + if ((oldTag === undefined && newTag === TAG_DM) || + (oldTag === TAG_DM && newTag === undefined) + ) { + return Rooms.guessAndSetDMRoom( + room, newTag === TAG_DM, + ).catch((err) => { + const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); + console.error("Failed to set direct chat tag " + err); + Modal.createTrackedDialog('Failed to set direct chat tag', '', ErrorDialog, { + title: _t('Failed to set direct chat tag'), + description: ((err && err.message) ? err.message : _t('Operation failed')), + }); + }); + } + + const hasChangedSubLists = oldTag !== newTag; + + // More evilness: We will still be dealing with moving to favourites/low prio, + // but we avoid ever doing a request with TAG_DM. + // + // if we moved lists, remove the old tag + if (oldTag && oldTag !== TAG_DM && + hasChangedSubLists + ) { + const promiseToDelete = matrixClient.deleteRoomTag( + roomId, oldTag, + ).catch(function (err) { + const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); + console.error("Failed to remove tag " + oldTag + " from room: " + err); + Modal.createTrackedDialog('Failed to remove tag from room', '', ErrorDialog, { + title: _t('Failed to remove tag %(tagName)s from room', {tagName: oldTag}), + description: ((err && err.message) ? err.message : _t('Operation failed')), + }); + }); + + promises.push(promiseToDelete); + } + + // if we moved lists or the ordering changed, add the new tag + if (newTag && newTag !== TAG_DM && + (hasChangedSubLists || metaData) + ) { + // metaData is the body of the PUT to set the tag, so it must + // at least be an empty object. + metaData = metaData || {}; + + const promiseToAdd = matrixClient.setRoomTag(roomId, newTag, metaData).catch(function (err) { + const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); + console.error("Failed to add tag " + newTag + " to room: " + err); + Modal.createTrackedDialog('Failed to add tag to room', '', ErrorDialog, { + title: _t('Failed to add tag %(tagName)s to room', {tagName: newTag}), + description: ((err && err.message) ? err.message : _t('Operation failed')), + }); + + throw err; + }); + + promises.push(promiseToAdd); + } + + return Promise.all(promises); + }, () => { + // For an optimistic update + return { + room, oldTag, newTag, metaData, + }; + }); + } +} diff --git a/src/actions/TagOrderActions.js b/src/actions/TagOrderActions.js deleted file mode 100644 index a257ff16d8..0000000000 --- a/src/actions/TagOrderActions.js +++ /dev/null @@ -1,109 +0,0 @@ -/* -Copyright 2017 New Vector Ltd - -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 Analytics from '../Analytics'; -import { asyncAction } from './actionCreators'; -import TagOrderStore from '../stores/TagOrderStore'; - -const TagOrderActions = {}; - -/** - * Creates an action thunk that will do an asynchronous request to - * move a tag in TagOrderStore to destinationIx. - * - * @param {MatrixClient} matrixClient the matrix client to set the - * account data on. - * @param {string} tag the tag to move. - * @param {number} destinationIx the new position of the tag. - * @returns {function} an action thunk that will dispatch actions - * indicating the status of the request. - * @see asyncAction - */ -TagOrderActions.moveTag = function(matrixClient, tag, destinationIx) { - // Only commit tags if the state is ready, i.e. not null - let tags = TagOrderStore.getOrderedTags(); - let removedTags = TagOrderStore.getRemovedTagsAccountData() || []; - if (!tags) { - return; - } - - tags = tags.filter((t) => t !== tag); - tags = [...tags.slice(0, destinationIx), tag, ...tags.slice(destinationIx)]; - - removedTags = removedTags.filter((t) => t !== tag); - - const storeId = TagOrderStore.getStoreId(); - - return asyncAction('TagOrderActions.moveTag', () => { - Analytics.trackEvent('TagOrderActions', 'commitTagOrdering'); - return matrixClient.setAccountData( - 'im.vector.web.tag_ordering', - {tags, removedTags, _storeId: storeId}, - ); - }, () => { - // For an optimistic update - return {tags, removedTags}; - }); -}; - -/** - * Creates an action thunk that will do an asynchronous request to - * label a tag as removed in im.vector.web.tag_ordering account data. - * - * The reason this is implemented with new state `removedTags` is that - * we incrementally and initially populate `tags` with groups that - * have been joined. If we remove a group from `tags`, it will just - * get added (as it looks like a group we've recently joined). - * - * NB: If we ever support adding of tags (which is planned), we should - * take special care to remove the tag from `removedTags` when we add - * it. - * - * @param {MatrixClient} matrixClient the matrix client to set the - * account data on. - * @param {string} tag the tag to remove. - * @returns {function} an action thunk that will dispatch actions - * indicating the status of the request. - * @see asyncAction - */ -TagOrderActions.removeTag = function(matrixClient, tag) { - // Don't change tags, just removedTags - const tags = TagOrderStore.getOrderedTags(); - const removedTags = TagOrderStore.getRemovedTagsAccountData() || []; - - if (removedTags.includes(tag)) { - // Return a thunk that doesn't do anything, we don't even need - // an asynchronous action here, the tag is already removed. - return () => {}; - } - - removedTags.push(tag); - - const storeId = TagOrderStore.getStoreId(); - - return asyncAction('TagOrderActions.removeTag', () => { - Analytics.trackEvent('TagOrderActions', 'removeTag'); - return matrixClient.setAccountData( - 'im.vector.web.tag_ordering', - {tags, removedTags, _storeId: storeId}, - ); - }, () => { - // For an optimistic update - return {removedTags}; - }); -}; - -export default TagOrderActions; diff --git a/src/actions/TagOrderActions.ts b/src/actions/TagOrderActions.ts new file mode 100644 index 0000000000..57dd0b8793 --- /dev/null +++ b/src/actions/TagOrderActions.ts @@ -0,0 +1,112 @@ +/* +Copyright 2017 New Vector Ltd +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 Analytics from '../Analytics'; +import { asyncAction } from './actionCreators'; +import TagOrderStore from '../stores/TagOrderStore'; +import { AsyncActionPayload } from "../dispatcher"; +import { MatrixClient } from "matrix-js-sdk/src/client"; + +export default class TagOrderActions { + + /** + * Creates an action thunk that will do an asynchronous request to + * move a tag in TagOrderStore to destinationIx. + * + * @param {MatrixClient} matrixClient the matrix client to set the + * account data on. + * @param {string} tag the tag to move. + * @param {number} destinationIx the new position of the tag. + * @returns {AsyncActionPayload} an async action payload that will + * dispatch actions indicating the status of the request. + * @see asyncAction + */ + public static moveTag(matrixClient: MatrixClient, tag: string, destinationIx: number): AsyncActionPayload { + // Only commit tags if the state is ready, i.e. not null + let tags = TagOrderStore.getOrderedTags(); + let removedTags = TagOrderStore.getRemovedTagsAccountData() || []; + if (!tags) { + return; + } + + tags = tags.filter((t) => t !== tag); + tags = [...tags.slice(0, destinationIx), tag, ...tags.slice(destinationIx)]; + + removedTags = removedTags.filter((t) => t !== tag); + + const storeId = TagOrderStore.getStoreId(); + + return asyncAction('TagOrderActions.moveTag', () => { + Analytics.trackEvent('TagOrderActions', 'commitTagOrdering'); + return matrixClient.setAccountData( + 'im.vector.web.tag_ordering', + {tags, removedTags, _storeId: storeId}, + ); + }, () => { + // For an optimistic update + return {tags, removedTags}; + }); + }; + + /** + * Creates an action thunk that will do an asynchronous request to + * label a tag as removed in im.vector.web.tag_ordering account data. + * + * The reason this is implemented with new state `removedTags` is that + * we incrementally and initially populate `tags` with groups that + * have been joined. If we remove a group from `tags`, it will just + * get added (as it looks like a group we've recently joined). + * + * NB: If we ever support adding of tags (which is planned), we should + * take special care to remove the tag from `removedTags` when we add + * it. + * + * @param {MatrixClient} matrixClient the matrix client to set the + * account data on. + * @param {string} tag the tag to remove. + * @returns {function} an async action payload that will dispatch + * actions indicating the status of the request. + * @see asyncAction + */ + public static removeTag(matrixClient: MatrixClient, tag: string): AsyncActionPayload { + // Don't change tags, just removedTags + const tags = TagOrderStore.getOrderedTags(); + const removedTags = TagOrderStore.getRemovedTagsAccountData() || []; + + if (removedTags.includes(tag)) { + // Return a thunk that doesn't do anything, we don't even need + // an asynchronous action here, the tag is already removed. + return () => { + }; + } + + removedTags.push(tag); + + const storeId = TagOrderStore.getStoreId(); + + return asyncAction('TagOrderActions.removeTag', () => { + Analytics.trackEvent('TagOrderActions', 'removeTag'); + return matrixClient.setAccountData( + 'im.vector.web.tag_ordering', + {tags, removedTags, _storeId: storeId}, + ); + }, () => { + // For an optimistic update + return {removedTags}; + }); + } +} diff --git a/src/actions/actionCreators.js b/src/actions/actionCreators.ts similarity index 80% rename from src/actions/actionCreators.js rename to src/actions/actionCreators.ts index 967ce609e7..3a0132a969 100644 --- a/src/actions/actionCreators.js +++ b/src/actions/actionCreators.ts @@ -1,5 +1,6 @@ /* Copyright 2017 New Vector Ltd +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. @@ -14,6 +15,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { AsyncActionPayload } from "../dispatcher"; + /** * Create an action thunk that will dispatch actions indicating the current * status of the Promise returned by fn. @@ -25,9 +28,9 @@ limitations under the License. * @param {function?} pendingFn a function that returns an object to assign * to the `request` key of the ${id}.pending * payload. - * @returns {function} an action thunk - a function that uses its single - * argument as a dispatch function to dispatch the - * following actions: + * @returns {AsyncActionPayload} an async action payload. Includes a function + * that uses its single argument as a dispatch function + * to dispatch the following actions: * `${id}.pending` and either * `${id}.success` or * `${id}.failure`. @@ -41,8 +44,8 @@ limitations under the License. * result is the result of the promise returned by * `fn`. */ -export function asyncAction(id, fn, pendingFn) { - return (dispatch) => { +export function asyncAction(id: string, fn: () => Promise, pendingFn: () => any): AsyncActionPayload { + const helper = (dispatch) => { dispatch({ action: id + '.pending', request: @@ -54,4 +57,5 @@ export function asyncAction(id, fn, pendingFn) { dispatch({action: id + '.failure', err}); }); }; + return new AsyncActionPayload(helper); } diff --git a/src/dispatcher.js b/src/dispatcher.js deleted file mode 100644 index 5dfaa11345..0000000000 --- a/src/dispatcher.js +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright 2015, 2016 OpenMarket Ltd -Copyright 2017 New Vector Ltd - -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. -*/ - -'use strict'; - -import flux from "flux"; - -class MatrixDispatcher extends flux.Dispatcher { - /** - * @param {Object|function} payload Required. The payload to dispatch. - * If an Object, must contain at least an 'action' key. - * If a function, must have the signature (dispatch) => {...}. - * @param {boolean=} sync Optional. Pass true to dispatch - * synchronously. This is useful for anything triggering - * an operation that the browser requires user interaction - * for. - */ - dispatch(payload, sync) { - // Allow for asynchronous dispatching by accepting payloads that have the - // type `function (dispatch) {...}` - if (typeof payload === 'function') { - payload((action) => { - this.dispatch(action, sync); - }); - return; - } - - if (sync) { - super.dispatch(payload); - } else { - // Unless the caller explicitly asked for us to dispatch synchronously, - // we always set a timeout to do this: The flux dispatcher complains - // if you dispatch from within a dispatch, so rather than action - // handlers having to worry about not calling anything that might - // then dispatch, we just do dispatches asynchronously. - setTimeout(super.dispatch.bind(this, payload), 0); - } - } -} - -if (global.mxDispatcher === undefined) { - global.mxDispatcher = new MatrixDispatcher(); -} -export default global.mxDispatcher; diff --git a/src/dispatcher.ts b/src/dispatcher.ts new file mode 100644 index 0000000000..fce99df055 --- /dev/null +++ b/src/dispatcher.ts @@ -0,0 +1,121 @@ +/* +Copyright 2015, 2016 OpenMarket Ltd +Copyright 2017 New Vector Ltd +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 { Dispatcher } from "flux"; + +export enum Action { + // TODO: Populate with actual actions +} + +// Dispatcher actions also extend into any arbitrary string, so support that. +export type DispatcherAction = Action | string; + +/** + * The base dispatch type exposed by our dispatcher. + */ +export interface ActionPayload { + [property: string]: any; // effectively makes this 'extends Object' + action: DispatcherAction; +} + +/** + * The function the dispatcher calls when ready for an AsyncActionPayload. The + * single argument is used to start a dispatch. First the dispatcher calls the + * outer function, then when the called function is ready it calls the cb + * function to issue the dispatch. It may call the callback repeatedly if needed. + */ +export type AsyncActionFn = (cb: (action: ActionPayload) => void) => void; + +/** + * An async version of ActionPayload + */ +export class AsyncActionPayload implements ActionPayload { + /** + * The function the dispatcher should call. + */ + public readonly fn: AsyncActionFn; + + /** + * @deprecated Not used on AsyncActionPayload. + */ + public get action(): DispatcherAction { + return "NOT_USED"; + } + + /** + * Create a new AsyncActionPayload with the given ready function. + * @param {AsyncActionFn} readyFn The function to be called when the + * dispatcher is ready. + */ + public constructor(readyFn: AsyncActionFn) { + this.fn = readyFn; + } +} + +/** + * A dispatcher for ActionPayloads (the default within the SDK). + */ +export class MatrixDispatcher extends Dispatcher { + /** + * Dispatches an event on the dispatcher's event bus. + * @param {ActionPayload} payload Required. The payload to dispatch. + * @param {boolean=false} sync Optional. Pass true to dispatch + * synchronously. This is useful for anything triggering + * an operation that the browser requires user interaction + * for. Default false (async). + */ + dispatch(payload: ActionPayload, sync = false) { + if (payload instanceof AsyncActionPayload) { + payload.fn((action: ActionPayload) => { + this.dispatch(action, sync); + }); + return; + } + + if (sync) { + super.dispatch(payload); + } else { + // Unless the caller explicitly asked for us to dispatch synchronously, + // we always set a timeout to do this: The flux dispatcher complains + // if you dispatch from within a dispatch, so rather than action + // handlers having to worry about not calling anything that might + // then dispatch, we just do dispatches asynchronously. + setTimeout(super.dispatch.bind(this, payload), 0); + } + } + + /** + * Shorthand for dispatch({action: Action.WHATEVER}, sync). No additional + * properties can be included with this version. + * @param {Action} action The action to dispatch. + * @param {boolean=false} sync Whether the dispatch should be sync or not. + * @see dispatch(action: ActionPayload, sync: boolean) + */ + fire(action: Action, sync = false) { + this.dispatch({action}, sync); + } +} + +export const defaultDispatcher = new MatrixDispatcher(); + +const anyGlobal = global; +if (!anyGlobal.mxDispatcher) { + anyGlobal.mxDispatcher = defaultDispatcher; +} + +export default defaultDispatcher; diff --git a/tsconfig.json b/tsconfig.json index b87f640734..8a01ca335e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,7 +14,8 @@ "jsx": "react", "types": [ "node", - "react" + "react", + "flux" ] }, "include": [ diff --git a/yarn.lock b/yarn.lock index 520e976b17..99a9d07c7a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1218,6 +1218,19 @@ resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7" integrity sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g== +"@types/fbemitter@*": + version "2.0.32" + resolved "https://registry.yarnpkg.com/@types/fbemitter/-/fbemitter-2.0.32.tgz#8ed204da0f54e9c8eaec31b1eec91e25132d082c" + integrity sha1-jtIE2g9U6cjq7DGx7skeJRMtCCw= + +"@types/flux@^3.1.9": + version "3.1.9" + resolved "https://registry.yarnpkg.com/@types/flux/-/flux-3.1.9.tgz#ddfc9641ee2e2e6cb6cd730c6a48ef82e2076711" + integrity sha512-bSbDf4tTuN9wn3LTGPnH9wnSSLtR5rV7UPWFpM00NJ1pSTBwCzeZG07XsZ9lBkxwngrqjDtM97PLt5IuIdCQUA== + dependencies: + "@types/fbemitter" "*" + "@types/react" "*" + "@types/glob@^7.1.1": version "7.1.1" resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575" @@ -1272,6 +1285,14 @@ resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw== +"@types/react@*": + version "16.9.35" + resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.35.tgz#a0830d172e8aadd9bd41709ba2281a3124bbd368" + integrity sha512-q0n0SsWcGc8nDqH2GJfWQWUOmZSJhXV64CjVN5SvcNti3TdEaA3AH0D8DwNmMdzjMAC/78tB8nAZIlV8yTz+zQ== + dependencies: + "@types/prop-types" "*" + csstype "^2.2.0" + "@types/react@16.9": version "16.9.32" resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.32.tgz#f6368625b224604148d1ddf5920e4fefbd98d383" From 90a898d03ff5e6da0a436136de167ee1547297c5 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 13 May 2020 20:41:41 -0600 Subject: [PATCH 26/86] Move dispatcher into a subdirectory We're expecting to have a whole bunch of types for the dispatched payloads, so pull the thing into a directory we can throw them in. --- src/BasePlatform.js | 2 +- src/CallHandler.js | 2 +- src/ContentMessages.js | 2 +- src/FromWidgetPostMessageApi.js | 2 +- src/Lifecycle.js | 2 +- src/Modal.js | 2 +- src/Notifier.js | 2 +- src/Presence.js | 2 +- src/Registration.js | 2 +- src/Resend.js | 2 +- src/ScalarMessaging.js | 2 +- src/SlashCommands.tsx | 2 +- src/UserActivity.js | 2 +- src/actions/MatrixActionCreators.js | 2 +- src/actions/RoomListActions.ts | 2 +- src/actions/TagOrderActions.ts | 2 +- src/actions/actionCreators.ts | 2 +- .../views/dialogs/eventindex/DisableEventIndexDialog.js | 2 +- .../views/dialogs/keybackup/NewRecoveryMethodDialog.js | 2 +- .../views/dialogs/keybackup/RecoveryMethodRemovedDialog.js | 2 +- src/components/structures/CustomRoomTagPanel.js | 2 +- src/components/structures/EmbeddedPage.js | 2 +- src/components/structures/GroupView.js | 2 +- src/components/structures/HomePage.tsx | 2 +- src/components/structures/LeftPanel.js | 2 +- src/components/structures/LoggedInView.tsx | 2 +- src/components/structures/MatrixChat.tsx | 2 +- src/components/structures/MyGroups.js | 2 +- src/components/structures/RightPanel.js | 2 +- src/components/structures/RoomDirectory.js | 2 +- src/components/structures/RoomStatusBar.js | 2 +- src/components/structures/RoomSubList.js | 2 +- src/components/structures/RoomView.js | 2 +- src/components/structures/SearchBox.js | 2 +- src/components/structures/TagPanel.js | 2 +- src/components/structures/TagPanelButtons.js | 2 +- src/components/structures/TimelinePanel.js | 2 +- src/components/structures/TopLeftMenuButton.js | 2 +- src/components/structures/UploadBar.js | 2 +- src/components/structures/auth/Registration.js | 2 +- src/components/structures/auth/SoftLogout.js | 2 +- src/components/views/avatars/MemberAvatar.js | 2 +- src/components/views/context_menus/MessageContextMenu.js | 2 +- src/components/views/context_menus/RoomTileContextMenu.js | 2 +- src/components/views/context_menus/TagTileContextMenu.js | 2 +- src/components/views/context_menus/TopLeftMenu.js | 2 +- src/components/views/dialogs/AddressPickerDialog.js | 2 +- src/components/views/dialogs/CreateGroupDialog.js | 2 +- src/components/views/dialogs/CryptoStoreTooNewDialog.js | 2 +- src/components/views/dialogs/DeviceVerifyDialog.js | 2 +- src/components/views/dialogs/IntegrationsDisabledDialog.js | 2 +- src/components/views/dialogs/InviteDialog.js | 2 +- src/components/views/dialogs/LogoutDialog.js | 2 +- src/components/views/dialogs/RoomSettingsDialog.js | 2 +- src/components/views/elements/ActionButton.js | 2 +- src/components/views/elements/AppTile.js | 2 +- src/components/views/elements/Flair.js | 2 +- src/components/views/elements/PersistedElement.js | 2 +- src/components/views/elements/Pill.js | 2 +- src/components/views/elements/ReplyThread.js | 2 +- src/components/views/elements/TagTile.js | 2 +- src/components/views/elements/Tooltip.js | 2 +- src/components/views/globals/CookieBar.js | 2 +- src/components/views/groups/GroupInviteTile.js | 2 +- src/components/views/groups/GroupMemberInfo.js | 2 +- src/components/views/groups/GroupMemberList.js | 2 +- src/components/views/groups/GroupMemberTile.js | 2 +- src/components/views/groups/GroupRoomInfo.js | 2 +- src/components/views/groups/GroupRoomTile.js | 2 +- src/components/views/groups/GroupTile.js | 2 +- src/components/views/messages/MKeyVerificationRequest.js | 2 +- src/components/views/messages/MessageActionBar.js | 2 +- src/components/views/messages/RoomCreate.js | 2 +- src/components/views/messages/TextualBody.js | 2 +- src/components/views/right_panel/HeaderButtons.js | 2 +- src/components/views/right_panel/UserInfo.js | 2 +- src/components/views/room_settings/ColorSettings.js | 2 +- src/components/views/room_settings/UrlPreviewSettings.js | 2 +- src/components/views/rooms/AppsDrawer.js | 2 +- src/components/views/rooms/AuxPanel.js | 2 +- src/components/views/rooms/EditMessageComposer.js | 2 +- src/components/views/rooms/EventTile.js | 2 +- src/components/views/rooms/ForwardMessage.js | 2 +- src/components/views/rooms/MemberInfo.js | 2 +- src/components/views/rooms/MemberList.js | 2 +- src/components/views/rooms/MemberTile.js | 2 +- src/components/views/rooms/MessageComposer.js | 2 +- src/components/views/rooms/PinnedEventTile.js | 2 +- src/components/views/rooms/ReplyPreview.js | 2 +- src/components/views/rooms/RoomBreadcrumbs.js | 2 +- src/components/views/rooms/RoomDetailList.js | 2 +- src/components/views/rooms/RoomList.js | 2 +- src/components/views/rooms/RoomPreviewBar.js | 2 +- src/components/views/rooms/RoomTile.js | 2 +- src/components/views/rooms/SendMessageComposer.js | 2 +- src/components/views/rooms/Stickerpicker.js | 2 +- src/components/views/rooms/ThirdPartyMemberInfo.js | 2 +- src/components/views/settings/ChangePassword.js | 2 +- src/components/views/settings/EnableNotificationsButton.js | 2 +- src/components/views/settings/IntegrationManager.js | 2 +- src/components/views/settings/SetIdServer.js | 2 +- .../views/settings/tabs/room/AdvancedRoomSettingsTab.js | 2 +- .../views/settings/tabs/room/GeneralRoomSettingsTab.js | 2 +- .../views/settings/tabs/user/GeneralUserSettingsTab.js | 2 +- .../views/settings/tabs/user/SecurityUserSettingsTab.js | 2 +- src/components/views/toasts/BulkUnverifiedSessionsToast.js | 2 +- src/components/views/toasts/VerificationRequestToast.js | 2 +- src/components/views/voip/CallPreview.js | 2 +- src/components/views/voip/CallView.js | 2 +- src/components/views/voip/IncomingCallBox.js | 2 +- src/components/views/voip/VideoView.js | 2 +- src/createRoom.js | 2 +- src/cryptodevices.js | 2 +- src/{ => dispatcher}/dispatcher.ts | 0 src/mjolnir/Mjolnir.js | 2 +- src/settings/SettingsStore.js | 2 +- src/settings/controllers/CustomStatusController.js | 2 +- src/stores/CustomRoomTagStore.js | 2 +- src/stores/GroupStore.js | 2 +- src/stores/LifecycleStore.js | 2 +- src/stores/RightPanelStore.js | 2 +- src/stores/RoomListStore.js | 2 +- src/stores/RoomViewStore.js | 2 +- src/stores/SessionStore.js | 2 +- src/stores/TagOrderStore.js | 2 +- src/theme.js | 2 +- src/utils/WidgetUtils.js | 2 +- src/verification.js | 2 +- test/components/views/rooms/RoomList-test.js | 2 +- test/test-utils.js | 2 +- 130 files changed, 129 insertions(+), 129 deletions(-) rename src/{ => dispatcher}/dispatcher.ts (100%) diff --git a/src/BasePlatform.js b/src/BasePlatform.js index 7214031586..46bd9150df 100644 --- a/src/BasePlatform.js +++ b/src/BasePlatform.js @@ -20,7 +20,7 @@ limitations under the License. */ import {MatrixClient} from "matrix-js-sdk"; -import dis from './dispatcher'; +import dis from './dispatcher/dispatcher'; import BaseEventIndexManager from './indexing/BaseEventIndexManager'; /** diff --git a/src/CallHandler.js b/src/CallHandler.js index 2bfe10850a..c95ed16eb3 100644 --- a/src/CallHandler.js +++ b/src/CallHandler.js @@ -59,7 +59,7 @@ import Modal from './Modal'; import * as sdk from './index'; import { _t } from './languageHandler'; import Matrix from 'matrix-js-sdk'; -import dis from './dispatcher'; +import dis from './dispatcher/dispatcher'; import { showUnknownDeviceDialogForCalls } from './cryptodevices'; import WidgetUtils from './utils/WidgetUtils'; import WidgetEchoStore from './stores/WidgetEchoStore'; diff --git a/src/ContentMessages.js b/src/ContentMessages.js index 34379c029b..4f5a1a1220 100644 --- a/src/ContentMessages.js +++ b/src/ContentMessages.js @@ -18,7 +18,7 @@ limitations under the License. 'use strict'; import extend from './extend'; -import dis from './dispatcher'; +import dis from './dispatcher/dispatcher'; import {MatrixClientPeg} from './MatrixClientPeg'; import * as sdk from './index'; import { _t } from './languageHandler'; diff --git a/src/FromWidgetPostMessageApi.js b/src/FromWidgetPostMessageApi.js index c9793d40f7..102afa6bf1 100644 --- a/src/FromWidgetPostMessageApi.js +++ b/src/FromWidgetPostMessageApi.js @@ -17,7 +17,7 @@ limitations under the License. */ import URL from 'url'; -import dis from './dispatcher'; +import dis from './dispatcher/dispatcher'; import WidgetMessagingEndpoint from './WidgetMessagingEndpoint'; import ActiveWidgetStore from './stores/ActiveWidgetStore'; import {MatrixClientPeg} from "./MatrixClientPeg"; diff --git a/src/Lifecycle.js b/src/Lifecycle.js index 1baa6c8e0c..22c5d48317 100644 --- a/src/Lifecycle.js +++ b/src/Lifecycle.js @@ -26,7 +26,7 @@ import Analytics from './Analytics'; import Notifier from './Notifier'; import UserActivity from './UserActivity'; import Presence from './Presence'; -import dis from './dispatcher'; +import dis from './dispatcher/dispatcher'; import DMRoomMap from './utils/DMRoomMap'; import Modal from './Modal'; import * as sdk from './index'; diff --git a/src/Modal.js b/src/Modal.js index de441740f1..9b9f190d58 100644 --- a/src/Modal.js +++ b/src/Modal.js @@ -18,7 +18,7 @@ limitations under the License. import React from 'react'; import ReactDOM from 'react-dom'; import Analytics from './Analytics'; -import dis from './dispatcher'; +import dis from './dispatcher/dispatcher'; import {defer} from './utils/promise'; import AsyncWrapper from './AsyncWrapper'; diff --git a/src/Notifier.js b/src/Notifier.js index ec92840998..2ffa92452b 100644 --- a/src/Notifier.js +++ b/src/Notifier.js @@ -21,7 +21,7 @@ import PlatformPeg from './PlatformPeg'; import * as TextForEvent from './TextForEvent'; import Analytics from './Analytics'; import * as Avatar from './Avatar'; -import dis from './dispatcher'; +import dis from './dispatcher/dispatcher'; import * as sdk from './index'; import { _t } from './languageHandler'; import Modal from './Modal'; diff --git a/src/Presence.js b/src/Presence.js index 2fc13a090b..42bca35f96 100644 --- a/src/Presence.js +++ b/src/Presence.js @@ -17,7 +17,7 @@ limitations under the License. */ import {MatrixClientPeg} from "./MatrixClientPeg"; -import dis from "./dispatcher"; +import dis from "./dispatcher/dispatcher"; import Timer from './utils/Timer'; // Time in ms after that a user is considered as unavailable/away diff --git a/src/Registration.js b/src/Registration.js index ca162bac03..32c3d9cc35 100644 --- a/src/Registration.js +++ b/src/Registration.js @@ -20,7 +20,7 @@ limitations under the License. * registration code. */ -import dis from './dispatcher'; +import dis from './dispatcher/dispatcher'; import * as sdk from './index'; import Modal from './Modal'; import { _t } from './languageHandler'; diff --git a/src/Resend.js b/src/Resend.js index 6d6c18cf27..f5f24bffa5 100644 --- a/src/Resend.js +++ b/src/Resend.js @@ -16,7 +16,7 @@ limitations under the License. */ import {MatrixClientPeg} from './MatrixClientPeg'; -import dis from './dispatcher'; +import dis from './dispatcher/dispatcher'; import { EventStatus } from 'matrix-js-sdk'; export default class Resend { diff --git a/src/ScalarMessaging.js b/src/ScalarMessaging.js index 9731e42825..315c2d86f4 100644 --- a/src/ScalarMessaging.js +++ b/src/ScalarMessaging.js @@ -238,7 +238,7 @@ Example: import {MatrixClientPeg} from './MatrixClientPeg'; import { MatrixEvent } from 'matrix-js-sdk'; -import dis from './dispatcher'; +import dis from './dispatcher/dispatcher'; import WidgetUtils from './utils/WidgetUtils'; import RoomViewStore from './stores/RoomViewStore'; import { _t } from './languageHandler'; diff --git a/src/SlashCommands.tsx b/src/SlashCommands.tsx index fbb9e2eb0e..fd157b2b4c 100644 --- a/src/SlashCommands.tsx +++ b/src/SlashCommands.tsx @@ -21,7 +21,7 @@ limitations under the License. import * as React from 'react'; import {MatrixClientPeg} from './MatrixClientPeg'; -import dis from './dispatcher'; +import dis from './dispatcher/dispatcher'; import * as sdk from './index'; import {_t, _td} from './languageHandler'; import Modal from './Modal'; diff --git a/src/UserActivity.js b/src/UserActivity.js index 0d1b4d0cc0..0174aebaf5 100644 --- a/src/UserActivity.js +++ b/src/UserActivity.js @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import dis from './dispatcher'; +import dis from './dispatcher/dispatcher'; import Timer from './utils/Timer'; // important these are larger than the timeouts of timers diff --git a/src/actions/MatrixActionCreators.js b/src/actions/MatrixActionCreators.js index c89ec44435..93a4fcf07c 100644 --- a/src/actions/MatrixActionCreators.js +++ b/src/actions/MatrixActionCreators.js @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import dis from '../dispatcher'; +import dis from '../dispatcher/dispatcher'; // TODO: migrate from sync_state to MatrixActions.sync so that more js-sdk events // become dispatches in the same place. diff --git a/src/actions/RoomListActions.ts b/src/actions/RoomListActions.ts index 8ad3ad0781..0cdd3a86d8 100644 --- a/src/actions/RoomListActions.ts +++ b/src/actions/RoomListActions.ts @@ -23,7 +23,7 @@ import { _t } from '../languageHandler'; import * as sdk from '../index'; import { MatrixClient } from "matrix-js-sdk/src/client"; import { Room } from "matrix-js-sdk/src/models/room"; -import { AsyncActionPayload } from "../dispatcher"; +import { AsyncActionPayload } from "../dispatcher/dispatcher"; export default class RoomListActions { /** diff --git a/src/actions/TagOrderActions.ts b/src/actions/TagOrderActions.ts index 57dd0b8793..fa86e3a6b1 100644 --- a/src/actions/TagOrderActions.ts +++ b/src/actions/TagOrderActions.ts @@ -18,7 +18,7 @@ limitations under the License. import Analytics from '../Analytics'; import { asyncAction } from './actionCreators'; import TagOrderStore from '../stores/TagOrderStore'; -import { AsyncActionPayload } from "../dispatcher"; +import { AsyncActionPayload } from "../dispatcher/dispatcher"; import { MatrixClient } from "matrix-js-sdk/src/client"; export default class TagOrderActions { diff --git a/src/actions/actionCreators.ts b/src/actions/actionCreators.ts index 3a0132a969..78525a9509 100644 --- a/src/actions/actionCreators.ts +++ b/src/actions/actionCreators.ts @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { AsyncActionPayload } from "../dispatcher"; +import { AsyncActionPayload } from "../dispatcher/dispatcher"; /** * Create an action thunk that will dispatch actions indicating the current diff --git a/src/async-components/views/dialogs/eventindex/DisableEventIndexDialog.js b/src/async-components/views/dialogs/eventindex/DisableEventIndexDialog.js index 120b086ef6..8af0bf278e 100644 --- a/src/async-components/views/dialogs/eventindex/DisableEventIndexDialog.js +++ b/src/async-components/views/dialogs/eventindex/DisableEventIndexDialog.js @@ -17,7 +17,7 @@ limitations under the License. import React from 'react'; import * as sdk from '../../../../index'; import PropTypes from 'prop-types'; -import dis from "../../../../dispatcher"; +import dis from "../../../../dispatcher/dispatcher"; import { _t } from '../../../../languageHandler'; import SettingsStore, {SettingLevel} from "../../../../settings/SettingsStore"; diff --git a/src/async-components/views/dialogs/keybackup/NewRecoveryMethodDialog.js b/src/async-components/views/dialogs/keybackup/NewRecoveryMethodDialog.js index 9e2264a960..f00f2d9c3c 100644 --- a/src/async-components/views/dialogs/keybackup/NewRecoveryMethodDialog.js +++ b/src/async-components/views/dialogs/keybackup/NewRecoveryMethodDialog.js @@ -19,7 +19,7 @@ import React from "react"; import PropTypes from "prop-types"; import * as sdk from "../../../../index"; import {MatrixClientPeg} from '../../../../MatrixClientPeg'; -import dis from "../../../../dispatcher"; +import dis from "../../../../dispatcher/dispatcher"; import { _t } from "../../../../languageHandler"; import Modal from "../../../../Modal"; diff --git a/src/async-components/views/dialogs/keybackup/RecoveryMethodRemovedDialog.js b/src/async-components/views/dialogs/keybackup/RecoveryMethodRemovedDialog.js index c5222dafd5..722334cd70 100644 --- a/src/async-components/views/dialogs/keybackup/RecoveryMethodRemovedDialog.js +++ b/src/async-components/views/dialogs/keybackup/RecoveryMethodRemovedDialog.js @@ -18,7 +18,7 @@ limitations under the License. import React from "react"; import PropTypes from "prop-types"; import * as sdk from "../../../../index"; -import dis from "../../../../dispatcher"; +import dis from "../../../../dispatcher/dispatcher"; import { _t } from "../../../../languageHandler"; import Modal from "../../../../Modal"; diff --git a/src/components/structures/CustomRoomTagPanel.js b/src/components/structures/CustomRoomTagPanel.js index 6e392ea505..2753d5c4da 100644 --- a/src/components/structures/CustomRoomTagPanel.js +++ b/src/components/structures/CustomRoomTagPanel.js @@ -18,7 +18,7 @@ import React from 'react'; import CustomRoomTagStore from '../../stores/CustomRoomTagStore'; import AutoHideScrollbar from './AutoHideScrollbar'; import * as sdk from '../../index'; -import dis from '../../dispatcher'; +import dis from '../../dispatcher/dispatcher'; import classNames from 'classnames'; import * as FormattingUtils from '../../utils/FormattingUtils'; diff --git a/src/components/structures/EmbeddedPage.js b/src/components/structures/EmbeddedPage.js index 0aababf030..49ba3d1227 100644 --- a/src/components/structures/EmbeddedPage.js +++ b/src/components/structures/EmbeddedPage.js @@ -23,7 +23,7 @@ import PropTypes from 'prop-types'; import request from 'browser-request'; import { _t } from '../../languageHandler'; import sanitizeHtml from 'sanitize-html'; -import dis from '../../dispatcher'; +import dis from '../../dispatcher/dispatcher'; import {MatrixClientPeg} from '../../MatrixClientPeg'; import classnames from 'classnames'; import MatrixClientContext from "../../contexts/MatrixClientContext"; diff --git a/src/components/structures/GroupView.js b/src/components/structures/GroupView.js index 3b32e5c907..1311d6e4f6 100644 --- a/src/components/structures/GroupView.js +++ b/src/components/structures/GroupView.js @@ -21,7 +21,7 @@ import createReactClass from 'create-react-class'; import PropTypes from 'prop-types'; import {MatrixClientPeg} from '../../MatrixClientPeg'; import * as sdk from '../../index'; -import dis from '../../dispatcher'; +import dis from '../../dispatcher/dispatcher'; import { getHostingLink } from '../../utils/HostingLink'; import { sanitizedHtmlNode } from '../../HtmlUtils'; import { _t, _td } from '../../languageHandler'; diff --git a/src/components/structures/HomePage.tsx b/src/components/structures/HomePage.tsx index ddf9cd6d00..ff8d35a114 100644 --- a/src/components/structures/HomePage.tsx +++ b/src/components/structures/HomePage.tsx @@ -21,7 +21,7 @@ import { getHomePageUrl } from "../../utils/pages"; import { _t } from "../../languageHandler"; import SdkConfig from "../../SdkConfig"; import * as sdk from "../../index"; -import dis from "../../dispatcher"; +import dis from "../../dispatcher/dispatcher"; const onClickSendDm = () => dis.dispatch({action: 'view_create_chat'}); const onClickExplore = () => dis.dispatch({action: 'view_room_directory'}); diff --git a/src/components/structures/LeftPanel.js b/src/components/structures/LeftPanel.js index a9cd12199b..adba858fa3 100644 --- a/src/components/structures/LeftPanel.js +++ b/src/components/structures/LeftPanel.js @@ -21,7 +21,7 @@ import PropTypes from 'prop-types'; import classNames from 'classnames'; import { Key } from '../../Keyboard'; import * as sdk from '../../index'; -import dis from '../../dispatcher'; +import dis from '../../dispatcher/dispatcher'; import * as VectorConferenceHandler from '../../VectorConferenceHandler'; import SettingsStore from '../../settings/SettingsStore'; import {_t} from "../../languageHandler"; diff --git a/src/components/structures/LoggedInView.tsx b/src/components/structures/LoggedInView.tsx index 9de2aac8e9..e2aa523b8c 100644 --- a/src/components/structures/LoggedInView.tsx +++ b/src/components/structures/LoggedInView.tsx @@ -27,7 +27,7 @@ import PageTypes from '../../PageTypes'; import CallMediaHandler from '../../CallMediaHandler'; import { fixupColorFonts } from '../../utils/FontManager'; import * as sdk from '../../index'; -import dis from '../../dispatcher'; +import dis from '../../dispatcher/dispatcher'; import sessionStore from '../../stores/SessionStore'; import {MatrixClientPeg, MatrixClientCreds} from '../../MatrixClientPeg'; import SettingsStore from "../../settings/SettingsStore"; diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index e553057acb..973d301420 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -34,7 +34,7 @@ import {MatrixClientPeg} from "../../MatrixClientPeg"; import PlatformPeg from "../../PlatformPeg"; import SdkConfig from "../../SdkConfig"; import * as RoomListSorter from "../../RoomListSorter"; -import dis from "../../dispatcher"; +import dis from "../../dispatcher/dispatcher"; import Notifier from '../../Notifier'; import Modal from "../../Modal"; diff --git a/src/components/structures/MyGroups.js b/src/components/structures/MyGroups.js index f179cab6ad..e2a3d6e71f 100644 --- a/src/components/structures/MyGroups.js +++ b/src/components/structures/MyGroups.js @@ -19,7 +19,7 @@ import React from 'react'; import createReactClass from 'create-react-class'; import * as sdk from '../../index'; import { _t } from '../../languageHandler'; -import dis from '../../dispatcher'; +import dis from '../../dispatcher/dispatcher'; import AccessibleButton from '../views/elements/AccessibleButton'; import MatrixClientContext from "../../contexts/MatrixClientContext"; import AutoHideScrollbar from "./AutoHideScrollbar"; diff --git a/src/components/structures/RightPanel.js b/src/components/structures/RightPanel.js index 34652098b3..c6c330a202 100644 --- a/src/components/structures/RightPanel.js +++ b/src/components/structures/RightPanel.js @@ -22,7 +22,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import * as sdk from '../../index'; -import dis from '../../dispatcher'; +import dis from '../../dispatcher/dispatcher'; import RateLimitedFunc from '../../ratelimitedfunc'; import { showGroupInviteDialog, showGroupAddRoomDialog } from '../../GroupAddressPicker'; import GroupStore from '../../stores/GroupStore'; diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index 86353cd532..eb784a1083 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -20,7 +20,7 @@ import React from 'react'; import createReactClass from 'create-react-class'; import {MatrixClientPeg} from "../../MatrixClientPeg"; import * as sdk from "../../index"; -import dis from "../../dispatcher"; +import dis from "../../dispatcher/dispatcher"; import Modal from "../../Modal"; import { linkifyAndSanitizeHtml } from '../../HtmlUtils'; import PropTypes from 'prop-types'; diff --git a/src/components/structures/RoomStatusBar.js b/src/components/structures/RoomStatusBar.js index 639f38a119..ae628fd06a 100644 --- a/src/components/structures/RoomStatusBar.js +++ b/src/components/structures/RoomStatusBar.js @@ -25,7 +25,7 @@ import * as sdk from '../../index'; import {MatrixClientPeg} from '../../MatrixClientPeg'; import Resend from '../../Resend'; import * as cryptodevices from '../../cryptodevices'; -import dis from '../../dispatcher'; +import dis from '../../dispatcher/dispatcher'; import {messageForResourceLimitError, messageForSendError} from '../../utils/ErrorUtils'; const STATUS_BAR_HIDDEN = 0; diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index 4e8e51c3cc..d1abacd2d8 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -20,7 +20,7 @@ limitations under the License. import React, {createRef} from 'react'; import classNames from 'classnames'; import * as sdk from '../../index'; -import dis from '../../dispatcher'; +import dis from '../../dispatcher/dispatcher'; import * as Unread from '../../Unread'; import * as RoomNotifs from '../../RoomNotifs'; import * as FormattingUtils from '../../utils/FormattingUtils'; diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index f53929df4a..fc98758bda 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -34,7 +34,7 @@ import ContentMessages from '../../ContentMessages'; import Modal from '../../Modal'; import * as sdk from '../../index'; import CallHandler from '../../CallHandler'; -import dis from '../../dispatcher'; +import dis from '../../dispatcher/dispatcher'; import Tinter from '../../Tinter'; import rate_limited_func from '../../ratelimitedfunc'; import * as ObjectUtils from '../../ObjectUtils'; diff --git a/src/components/structures/SearchBox.js b/src/components/structures/SearchBox.js index 0f3f8a6be9..7e9d290bce 100644 --- a/src/components/structures/SearchBox.js +++ b/src/components/structures/SearchBox.js @@ -19,7 +19,7 @@ import React, {createRef} from 'react'; import createReactClass from 'create-react-class'; import PropTypes from 'prop-types'; import { Key } from '../../Keyboard'; -import dis from '../../dispatcher'; +import dis from '../../dispatcher/dispatcher'; import { throttle } from 'lodash'; import AccessibleButton from '../../components/views/elements/AccessibleButton'; import classNames from 'classnames'; diff --git a/src/components/structures/TagPanel.js b/src/components/structures/TagPanel.js index 6642cce098..713ed004b0 100644 --- a/src/components/structures/TagPanel.js +++ b/src/components/structures/TagPanel.js @@ -22,7 +22,7 @@ import TagOrderStore from '../../stores/TagOrderStore'; import GroupActions from '../../actions/GroupActions'; import * as sdk from '../../index'; -import dis from '../../dispatcher'; +import dis from '../../dispatcher/dispatcher'; import { _t } from '../../languageHandler'; import { Droppable } from 'react-beautiful-dnd'; diff --git a/src/components/structures/TagPanelButtons.js b/src/components/structures/TagPanelButtons.js index 93a596baa3..4b00da3cbf 100644 --- a/src/components/structures/TagPanelButtons.js +++ b/src/components/structures/TagPanelButtons.js @@ -17,7 +17,7 @@ limitations under the License. import React from 'react'; import createReactClass from 'create-react-class'; import * as sdk from '../../index'; -import dis from '../../dispatcher'; +import dis from '../../dispatcher/dispatcher'; import Modal from '../../Modal'; import { _t } from '../../languageHandler'; diff --git a/src/components/structures/TimelinePanel.js b/src/components/structures/TimelinePanel.js index 6a08cd78eb..da1369c45f 100644 --- a/src/components/structures/TimelinePanel.js +++ b/src/components/structures/TimelinePanel.js @@ -29,7 +29,7 @@ import {MatrixClientPeg} from "../../MatrixClientPeg"; import * as ObjectUtils from "../../ObjectUtils"; import UserActivity from "../../UserActivity"; import Modal from "../../Modal"; -import dis from "../../dispatcher"; +import dis from "../../dispatcher/dispatcher"; import * as sdk from "../../index"; import { Key } from '../../Keyboard'; import Timer from '../../utils/Timer'; diff --git a/src/components/structures/TopLeftMenuButton.js b/src/components/structures/TopLeftMenuButton.js index ebd7aaae89..234dc661f9 100644 --- a/src/components/structures/TopLeftMenuButton.js +++ b/src/components/structures/TopLeftMenuButton.js @@ -22,7 +22,7 @@ import BaseAvatar from '../views/avatars/BaseAvatar'; import {MatrixClientPeg} from '../../MatrixClientPeg'; import * as Avatar from '../../Avatar'; import { _t } from '../../languageHandler'; -import dis from "../../dispatcher"; +import dis from "../../dispatcher/dispatcher"; import {ContextMenu, ContextMenuButton} from "./ContextMenu"; const AVATAR_SIZE = 28; diff --git a/src/components/structures/UploadBar.js b/src/components/structures/UploadBar.js index 1aec63f04e..421d1d79a7 100644 --- a/src/components/structures/UploadBar.js +++ b/src/components/structures/UploadBar.js @@ -19,7 +19,7 @@ import React from 'react'; import createReactClass from 'create-react-class'; import PropTypes from 'prop-types'; import ContentMessages from '../../ContentMessages'; -import dis from "../../dispatcher"; +import dis from "../../dispatcher/dispatcher"; import filesize from "filesize"; import { _t } from '../../languageHandler'; diff --git a/src/components/structures/auth/Registration.js b/src/components/structures/auth/Registration.js index 7818496e71..a30a13aceb 100644 --- a/src/components/structures/auth/Registration.js +++ b/src/components/structures/auth/Registration.js @@ -32,7 +32,7 @@ import * as Lifecycle from '../../../Lifecycle'; import {MatrixClientPeg} from "../../../MatrixClientPeg"; import AuthPage from "../../views/auth/AuthPage"; import Login from "../../../Login"; -import dis from "../../../dispatcher"; +import dis from "../../../dispatcher/dispatcher"; // Phases // Show controls to configure server details diff --git a/src/components/structures/auth/SoftLogout.js b/src/components/structures/auth/SoftLogout.js index 08ab7e8a61..7c25767291 100644 --- a/src/components/structures/auth/SoftLogout.js +++ b/src/components/structures/auth/SoftLogout.js @@ -18,7 +18,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import {_t} from '../../../languageHandler'; import * as sdk from '../../../index'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import * as Lifecycle from '../../../Lifecycle'; import Modal from '../../../Modal'; import {MatrixClientPeg} from "../../../MatrixClientPeg"; diff --git a/src/components/views/avatars/MemberAvatar.js b/src/components/views/avatars/MemberAvatar.js index 826aa5fddf..89314cfef7 100644 --- a/src/components/views/avatars/MemberAvatar.js +++ b/src/components/views/avatars/MemberAvatar.js @@ -20,7 +20,7 @@ import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; import * as Avatar from '../../../Avatar'; import * as sdk from "../../../index"; -import dis from "../../../dispatcher"; +import dis from "../../../dispatcher/dispatcher"; export default createReactClass({ displayName: 'MemberAvatar', diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index 70ab80e6cc..2c835e6967 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -23,7 +23,7 @@ import createReactClass from 'create-react-class'; import {EventStatus} from 'matrix-js-sdk'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; import Modal from '../../../Modal'; diff --git a/src/components/views/context_menus/RoomTileContextMenu.js b/src/components/views/context_menus/RoomTileContextMenu.js index d281656bbe..b08cf3be60 100644 --- a/src/components/views/context_menus/RoomTileContextMenu.js +++ b/src/components/views/context_menus/RoomTileContextMenu.js @@ -24,7 +24,7 @@ import classNames from 'classnames'; import * as sdk from '../../../index'; import { _t, _td } from '../../../languageHandler'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import DMRoomMap from '../../../utils/DMRoomMap'; import * as Rooms from '../../../Rooms'; import * as RoomNotifs from '../../../RoomNotifs'; diff --git a/src/components/views/context_menus/TagTileContextMenu.js b/src/components/views/context_menus/TagTileContextMenu.js index 7313a278cc..ff1a7f1b14 100644 --- a/src/components/views/context_menus/TagTileContextMenu.js +++ b/src/components/views/context_menus/TagTileContextMenu.js @@ -18,7 +18,7 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; import { _t } from '../../../languageHandler'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import TagOrderActions from '../../../actions/TagOrderActions'; import * as sdk from '../../../index'; import {MenuItem} from "../../structures/ContextMenu"; diff --git a/src/components/views/context_menus/TopLeftMenu.js b/src/components/views/context_menus/TopLeftMenu.js index 4448ecd041..3ec857be2f 100644 --- a/src/components/views/context_menus/TopLeftMenu.js +++ b/src/components/views/context_menus/TopLeftMenu.js @@ -17,7 +17,7 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import { _t } from '../../../languageHandler'; import LogoutDialog from "../dialogs/LogoutDialog"; import Modal from "../../../Modal"; diff --git a/src/components/views/dialogs/AddressPickerDialog.js b/src/components/views/dialogs/AddressPickerDialog.js index 451ec9cfde..41a819c005 100644 --- a/src/components/views/dialogs/AddressPickerDialog.js +++ b/src/components/views/dialogs/AddressPickerDialog.js @@ -24,7 +24,7 @@ import createReactClass from 'create-react-class'; import { _t, _td } from '../../../languageHandler'; import * as sdk from '../../../index'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import { addressTypes, getAddressType } from '../../../UserAddress.js'; import GroupStore from '../../../stores/GroupStore'; import * as Email from '../../../email'; diff --git a/src/components/views/dialogs/CreateGroupDialog.js b/src/components/views/dialogs/CreateGroupDialog.js index d465ef26a2..10285ccee0 100644 --- a/src/components/views/dialogs/CreateGroupDialog.js +++ b/src/components/views/dialogs/CreateGroupDialog.js @@ -18,7 +18,7 @@ import React from 'react'; import createReactClass from 'create-react-class'; import PropTypes from 'prop-types'; import * as sdk from '../../../index'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import { _t } from '../../../languageHandler'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; diff --git a/src/components/views/dialogs/CryptoStoreTooNewDialog.js b/src/components/views/dialogs/CryptoStoreTooNewDialog.js index 11e202b0cc..081e84696c 100644 --- a/src/components/views/dialogs/CryptoStoreTooNewDialog.js +++ b/src/components/views/dialogs/CryptoStoreTooNewDialog.js @@ -16,7 +16,7 @@ limitations under the License. import React from 'react'; import * as sdk from '../../../index'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import { _t } from '../../../languageHandler'; import Modal from '../../../Modal'; diff --git a/src/components/views/dialogs/DeviceVerifyDialog.js b/src/components/views/dialogs/DeviceVerifyDialog.js index a3f9430476..51f905d542 100644 --- a/src/components/views/dialogs/DeviceVerifyDialog.js +++ b/src/components/views/dialogs/DeviceVerifyDialog.js @@ -25,7 +25,7 @@ import * as FormattingUtils from '../../../utils/FormattingUtils'; import { _t } from '../../../languageHandler'; import {verificationMethods} from 'matrix-js-sdk/src/crypto'; import {ensureDMExists} from "../../../createRoom"; -import dis from "../../../dispatcher"; +import dis from "../../../dispatcher/dispatcher"; import SettingsStore from '../../../settings/SettingsStore'; import {SHOW_QR_CODE_METHOD} from "matrix-js-sdk/src/crypto/verification/QRCode"; import VerificationQREmojiOptions from "../verification/VerificationQREmojiOptions"; diff --git a/src/components/views/dialogs/IntegrationsDisabledDialog.js b/src/components/views/dialogs/IntegrationsDisabledDialog.js index 1ca638f0ab..2677963281 100644 --- a/src/components/views/dialogs/IntegrationsDisabledDialog.js +++ b/src/components/views/dialogs/IntegrationsDisabledDialog.js @@ -18,7 +18,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import {_t} from "../../../languageHandler"; import * as sdk from "../../../index"; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; export default class IntegrationsDisabledDialog extends React.Component { static propTypes = { diff --git a/src/components/views/dialogs/InviteDialog.js b/src/components/views/dialogs/InviteDialog.js index 7cbbf8ba64..e62c417a70 100644 --- a/src/components/views/dialogs/InviteDialog.js +++ b/src/components/views/dialogs/InviteDialog.js @@ -27,7 +27,7 @@ import {getHttpUriForMxc} from "matrix-js-sdk/src/content-repo"; import * as Email from "../../../email"; import {getDefaultIdentityServerUrl, useDefaultIdentityServer} from "../../../utils/IdentityServerUtils"; import {abbreviateUrl} from "../../../utils/UrlUtils"; -import dis from "../../../dispatcher"; +import dis from "../../../dispatcher/dispatcher"; import IdentityAuthClient from "../../../IdentityAuthClient"; import Modal from "../../../Modal"; import {humanizeTime} from "../../../utils/humanize"; diff --git a/src/components/views/dialogs/LogoutDialog.js b/src/components/views/dialogs/LogoutDialog.js index 23a6692b39..930acaa0b8 100644 --- a/src/components/views/dialogs/LogoutDialog.js +++ b/src/components/views/dialogs/LogoutDialog.js @@ -18,7 +18,7 @@ limitations under the License. import React from 'react'; import Modal from '../../../Modal'; import * as sdk from '../../../index'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import { _t } from '../../../languageHandler'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; diff --git a/src/components/views/dialogs/RoomSettingsDialog.js b/src/components/views/dialogs/RoomSettingsDialog.js index c5f807b23c..c2b98cd9f3 100644 --- a/src/components/views/dialogs/RoomSettingsDialog.js +++ b/src/components/views/dialogs/RoomSettingsDialog.js @@ -27,7 +27,7 @@ import NotificationSettingsTab from "../settings/tabs/room/NotificationSettingsT import BridgeSettingsTab from "../settings/tabs/room/BridgeSettingsTab"; import * as sdk from "../../../index"; import {MatrixClientPeg} from "../../../MatrixClientPeg"; -import dis from "../../../dispatcher"; +import dis from "../../../dispatcher/dispatcher"; import SettingsStore from "../../../settings/SettingsStore"; export default class RoomSettingsDialog extends React.Component { diff --git a/src/components/views/elements/ActionButton.js b/src/components/views/elements/ActionButton.js index d2277bd69a..7536d66653 100644 --- a/src/components/views/elements/ActionButton.js +++ b/src/components/views/elements/ActionButton.js @@ -18,7 +18,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; import AccessibleButton from './AccessibleButton'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import * as sdk from '../../../index'; import Analytics from '../../../Analytics'; diff --git a/src/components/views/elements/AppTile.js b/src/components/views/elements/AppTile.js index 80db1718f6..527436b0e4 100644 --- a/src/components/views/elements/AppTile.js +++ b/src/components/views/elements/AppTile.js @@ -31,7 +31,7 @@ import AppPermission from './AppPermission'; import AppWarning from './AppWarning'; import MessageSpinner from './MessageSpinner'; import WidgetUtils from '../../../utils/WidgetUtils'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import ActiveWidgetStore from '../../../stores/ActiveWidgetStore'; import classNames from 'classnames'; import {IntegrationManagers} from "../../../integrations/IntegrationManagers"; diff --git a/src/components/views/elements/Flair.js b/src/components/views/elements/Flair.js index bc657e9e91..0f06904b68 100644 --- a/src/components/views/elements/Flair.js +++ b/src/components/views/elements/Flair.js @@ -19,7 +19,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import FlairStore from '../../../stores/FlairStore'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import MatrixClientContext from "../../../contexts/MatrixClientContext"; diff --git a/src/components/views/elements/PersistedElement.js b/src/components/views/elements/PersistedElement.js index 53f2501f19..7f9bfdebf4 100644 --- a/src/components/views/elements/PersistedElement.js +++ b/src/components/views/elements/PersistedElement.js @@ -20,7 +20,7 @@ import PropTypes from 'prop-types'; import ResizeObserver from 'resize-observer-polyfill'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; // Shamelessly ripped off Modal.js. There's probably a better way // of doing reusable widgets like dialog boxes & menus where we go and diff --git a/src/components/views/elements/Pill.js b/src/components/views/elements/Pill.js index 1df12738c5..3e4ddb99e8 100644 --- a/src/components/views/elements/Pill.js +++ b/src/components/views/elements/Pill.js @@ -18,7 +18,7 @@ limitations under the License. import React from 'react'; import createReactClass from 'create-react-class'; import * as sdk from '../../../index'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import classNames from 'classnames'; import { Room, RoomMember } from 'matrix-js-sdk'; import PropTypes from 'prop-types'; diff --git a/src/components/views/elements/ReplyThread.js b/src/components/views/elements/ReplyThread.js index eae2d13f8a..8d3a7307b9 100644 --- a/src/components/views/elements/ReplyThread.js +++ b/src/components/views/elements/ReplyThread.js @@ -19,7 +19,7 @@ import React from 'react'; import * as sdk from '../../../index'; import {_t} from '../../../languageHandler'; import PropTypes from 'prop-types'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import {wantsDateSeparator} from '../../../DateUtils'; import {MatrixEvent} from 'matrix-js-sdk'; import {makeUserPermalink, RoomPermalinkCreator} from "../../../utils/permalinks/Permalinks"; diff --git a/src/components/views/elements/TagTile.js b/src/components/views/elements/TagTile.js index d8983ac2ea..1af681dadc 100644 --- a/src/components/views/elements/TagTile.js +++ b/src/components/views/elements/TagTile.js @@ -21,7 +21,7 @@ import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; import classNames from 'classnames'; import * as sdk from '../../../index'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import { isOnlyCtrlOrCmdIgnoreShiftKeyEvent } from '../../../Keyboard'; import * as FormattingUtils from '../../../utils/FormattingUtils'; diff --git a/src/components/views/elements/Tooltip.js b/src/components/views/elements/Tooltip.js index fd845d9db3..4807ade3db 100644 --- a/src/components/views/elements/Tooltip.js +++ b/src/components/views/elements/Tooltip.js @@ -22,7 +22,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import classNames from 'classnames'; const MIN_TOOLTIP_HEIGHT = 25; diff --git a/src/components/views/globals/CookieBar.js b/src/components/views/globals/CookieBar.js index 8774e4f1fa..bf264686d0 100644 --- a/src/components/views/globals/CookieBar.js +++ b/src/components/views/globals/CookieBar.js @@ -16,7 +16,7 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import { _t } from '../../../languageHandler'; import * as sdk from '../../../index'; import Analytics from '../../../Analytics'; diff --git a/src/components/views/groups/GroupInviteTile.js b/src/components/views/groups/GroupInviteTile.js index 91c930525d..bc5334f2de 100644 --- a/src/components/views/groups/GroupInviteTile.js +++ b/src/components/views/groups/GroupInviteTile.js @@ -20,7 +20,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; import * as sdk from '../../../index'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import {_t} from '../../../languageHandler'; import classNames from 'classnames'; import {MatrixClientPeg} from "../../../MatrixClientPeg"; diff --git a/src/components/views/groups/GroupMemberInfo.js b/src/components/views/groups/GroupMemberInfo.js index 9f5660386b..0d08771676 100644 --- a/src/components/views/groups/GroupMemberInfo.js +++ b/src/components/views/groups/GroupMemberInfo.js @@ -19,7 +19,7 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import Modal from '../../../Modal'; import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; diff --git a/src/components/views/groups/GroupMemberList.js b/src/components/views/groups/GroupMemberList.js index ca374d1309..b42e325a89 100644 --- a/src/components/views/groups/GroupMemberList.js +++ b/src/components/views/groups/GroupMemberList.js @@ -19,7 +19,7 @@ import React from 'react'; import createReactClass from 'create-react-class'; import { _t } from '../../../languageHandler'; import * as sdk from '../../../index'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import GroupStore from '../../../stores/GroupStore'; import PropTypes from 'prop-types'; import { showGroupInviteDialog } from '../../../GroupAddressPicker'; diff --git a/src/components/views/groups/GroupMemberTile.js b/src/components/views/groups/GroupMemberTile.js index f99d5c768c..05e3f6ac2a 100644 --- a/src/components/views/groups/GroupMemberTile.js +++ b/src/components/views/groups/GroupMemberTile.js @@ -20,7 +20,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; import * as sdk from '../../../index'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import { GroupMemberType } from '../../../groups'; import MatrixClientContext from "../../../contexts/MatrixClientContext"; diff --git a/src/components/views/groups/GroupRoomInfo.js b/src/components/views/groups/GroupRoomInfo.js index 3a20de7eca..8c9b39675e 100644 --- a/src/components/views/groups/GroupRoomInfo.js +++ b/src/components/views/groups/GroupRoomInfo.js @@ -18,7 +18,7 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import Modal from '../../../Modal'; import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; diff --git a/src/components/views/groups/GroupRoomTile.js b/src/components/views/groups/GroupRoomTile.js index 94d143b263..fd6969a49a 100644 --- a/src/components/views/groups/GroupRoomTile.js +++ b/src/components/views/groups/GroupRoomTile.js @@ -18,7 +18,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; import * as sdk from '../../../index'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import { GroupRoomType } from '../../../groups'; import MatrixClientContext from "../../../contexts/MatrixClientContext"; diff --git a/src/components/views/groups/GroupTile.js b/src/components/views/groups/GroupTile.js index b845a83c2a..44ce69ee39 100644 --- a/src/components/views/groups/GroupTile.js +++ b/src/components/views/groups/GroupTile.js @@ -19,7 +19,7 @@ import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; import { Draggable, Droppable } from 'react-beautiful-dnd'; import * as sdk from '../../../index'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import FlairStore from '../../../stores/FlairStore'; import MatrixClientContext from "../../../contexts/MatrixClientContext"; diff --git a/src/components/views/messages/MKeyVerificationRequest.js b/src/components/views/messages/MKeyVerificationRequest.js index f49ae1b6b1..a5b1ae26bb 100644 --- a/src/components/views/messages/MKeyVerificationRequest.js +++ b/src/components/views/messages/MKeyVerificationRequest.js @@ -21,7 +21,7 @@ import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; import {getNameForEventRoom, userLabelForEventRoom} from '../../../utils/KeyVerificationStateObserver'; -import dis from "../../../dispatcher"; +import dis from "../../../dispatcher/dispatcher"; import {RIGHT_PANEL_PHASES} from "../../../stores/RightPanelStorePhases"; export default class MKeyVerificationRequest extends React.Component { diff --git a/src/components/views/messages/MessageActionBar.js b/src/components/views/messages/MessageActionBar.js index 0cde90e417..48b9c58cb8 100644 --- a/src/components/views/messages/MessageActionBar.js +++ b/src/components/views/messages/MessageActionBar.js @@ -21,7 +21,7 @@ import PropTypes from 'prop-types'; import { _t } from '../../../languageHandler'; import * as sdk from '../../../index'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import Modal from '../../../Modal'; import {aboveLeftOf, ContextMenu, ContextMenuButton, useContextMenu} from '../../structures/ContextMenu'; import { isContentActionable, canEditContent } from '../../../utils/EventUtils'; diff --git a/src/components/views/messages/RoomCreate.js b/src/components/views/messages/RoomCreate.js index b5749ced97..95bc460636 100644 --- a/src/components/views/messages/RoomCreate.js +++ b/src/components/views/messages/RoomCreate.js @@ -19,7 +19,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import { RoomPermalinkCreator } from '../../../utils/permalinks/Permalinks'; import { _t } from '../../../languageHandler'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; diff --git a/src/components/views/messages/TextualBody.js b/src/components/views/messages/TextualBody.js index 882e331675..c762b95f83 100644 --- a/src/components/views/messages/TextualBody.js +++ b/src/components/views/messages/TextualBody.js @@ -25,7 +25,7 @@ import * as HtmlUtils from '../../../HtmlUtils'; import {formatDate} from '../../../DateUtils'; import * as sdk from '../../../index'; import Modal from '../../../Modal'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import { _t } from '../../../languageHandler'; import * as ContextMenu from '../../structures/ContextMenu'; import SettingsStore from "../../../settings/SettingsStore"; diff --git a/src/components/views/right_panel/HeaderButtons.js b/src/components/views/right_panel/HeaderButtons.js index 03b03218ee..1c66fe5828 100644 --- a/src/components/views/right_panel/HeaderButtons.js +++ b/src/components/views/right_panel/HeaderButtons.js @@ -19,7 +19,7 @@ limitations under the License. */ import React from 'react'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import RightPanelStore from "../../../stores/RightPanelStore"; export const HEADER_KIND_ROOM = "room"; diff --git a/src/components/views/right_panel/UserInfo.js b/src/components/views/right_panel/UserInfo.js index 478dc90418..daf1a9490d 100644 --- a/src/components/views/right_panel/UserInfo.js +++ b/src/components/views/right_panel/UserInfo.js @@ -21,7 +21,7 @@ import React, {useCallback, useMemo, useState, useEffect, useContext} from 'reac import PropTypes from 'prop-types'; import classNames from 'classnames'; import {Group, RoomMember, User} from 'matrix-js-sdk'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import Modal from '../../../Modal'; import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; diff --git a/src/components/views/room_settings/ColorSettings.js b/src/components/views/room_settings/ColorSettings.js index 1e06da0cd8..1d26e956ab 100644 --- a/src/components/views/room_settings/ColorSettings.js +++ b/src/components/views/room_settings/ColorSettings.js @@ -19,7 +19,7 @@ import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; import Tinter from '../../../Tinter'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import SettingsStore, {SettingLevel} from "../../../settings/SettingsStore"; const ROOM_COLORS = [ diff --git a/src/components/views/room_settings/UrlPreviewSettings.js b/src/components/views/room_settings/UrlPreviewSettings.js index 5de355ebd7..16dffd857b 100644 --- a/src/components/views/room_settings/UrlPreviewSettings.js +++ b/src/components/views/room_settings/UrlPreviewSettings.js @@ -23,7 +23,7 @@ import createReactClass from 'create-react-class'; import * as sdk from "../../../index"; import { _t, _td } from '../../../languageHandler'; import SettingsStore, {SettingLevel} from "../../../settings/SettingsStore"; -import dis from "../../../dispatcher"; +import dis from "../../../dispatcher/dispatcher"; import {MatrixClientPeg} from "../../../MatrixClientPeg"; diff --git a/src/components/views/rooms/AppsDrawer.js b/src/components/views/rooms/AppsDrawer.js index b64eb33435..06dfffad30 100644 --- a/src/components/views/rooms/AppsDrawer.js +++ b/src/components/views/rooms/AppsDrawer.js @@ -21,7 +21,7 @@ import createReactClass from 'create-react-class'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; import AppTile from '../elements/AppTile'; import Modal from '../../../Modal'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import * as sdk from '../../../index'; import * as ScalarMessaging from '../../../ScalarMessaging'; import { _t } from '../../../languageHandler'; diff --git a/src/components/views/rooms/AuxPanel.js b/src/components/views/rooms/AuxPanel.js index e102b0dba4..d6a3b156d5 100644 --- a/src/components/views/rooms/AuxPanel.js +++ b/src/components/views/rooms/AuxPanel.js @@ -20,7 +20,7 @@ import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; import {MatrixClientPeg} from "../../../MatrixClientPeg"; import * as sdk from '../../../index'; -import dis from "../../../dispatcher"; +import dis from "../../../dispatcher/dispatcher"; import * as ObjectUtils from '../../../ObjectUtils'; import AppsDrawer from './AppsDrawer'; import { _t } from '../../../languageHandler'; diff --git a/src/components/views/rooms/EditMessageComposer.js b/src/components/views/rooms/EditMessageComposer.js index 8353940c90..88ed76f118 100644 --- a/src/components/views/rooms/EditMessageComposer.js +++ b/src/components/views/rooms/EditMessageComposer.js @@ -18,7 +18,7 @@ import React from 'react'; import * as sdk from '../../../index'; import {_t} from '../../../languageHandler'; import PropTypes from 'prop-types'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import EditorModel from '../../../editor/model'; import {getCaretOffsetAndText} from '../../../editor/dom'; import {htmlSerializeIfNeeded, textSerialize, containsEmote, stripEmoteCommand} from '../../../editor/serialize'; diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index 33ee8a0f63..91fcacf0e5 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -25,7 +25,7 @@ import classNames from "classnames"; import { _t, _td } from '../../../languageHandler'; import * as TextForEvent from "../../../TextForEvent"; import * as sdk from "../../../index"; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import SettingsStore from "../../../settings/SettingsStore"; import {EventStatus} from 'matrix-js-sdk'; import {formatTime} from "../../../DateUtils"; diff --git a/src/components/views/rooms/ForwardMessage.js b/src/components/views/rooms/ForwardMessage.js index a3c00598a7..03ca32c5e6 100644 --- a/src/components/views/rooms/ForwardMessage.js +++ b/src/components/views/rooms/ForwardMessage.js @@ -19,7 +19,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; import { _t } from '../../../languageHandler'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import {Key} from '../../../Keyboard'; diff --git a/src/components/views/rooms/MemberInfo.js b/src/components/views/rooms/MemberInfo.js index 6b03000961..5d8e03a050 100644 --- a/src/components/views/rooms/MemberInfo.js +++ b/src/components/views/rooms/MemberInfo.js @@ -31,7 +31,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; import classNames from 'classnames'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import Modal from '../../../Modal'; import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; diff --git a/src/components/views/rooms/MemberList.js b/src/components/views/rooms/MemberList.js index 3779d461bb..e2d7e3f8e0 100644 --- a/src/components/views/rooms/MemberList.js +++ b/src/components/views/rooms/MemberList.js @@ -20,7 +20,7 @@ import React from 'react'; import createReactClass from 'create-react-class'; import { _t } from '../../../languageHandler'; import SdkConfig from '../../../SdkConfig'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import AutoHideScrollbar from "../../structures/AutoHideScrollbar"; import {isValid3pidInvite} from "../../../RoomInvite"; import rate_limited_func from "../../../ratelimitedfunc"; diff --git a/src/components/views/rooms/MemberTile.js b/src/components/views/rooms/MemberTile.js index 1c609afcaa..6842e27ed3 100644 --- a/src/components/views/rooms/MemberTile.js +++ b/src/components/views/rooms/MemberTile.js @@ -20,7 +20,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; import * as sdk from "../../../index"; -import dis from "../../../dispatcher"; +import dis from "../../../dispatcher/dispatcher"; import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from "../../../MatrixClientPeg"; diff --git a/src/components/views/rooms/MessageComposer.js b/src/components/views/rooms/MessageComposer.js index 4749742a7d..c05fe3d3a2 100644 --- a/src/components/views/rooms/MessageComposer.js +++ b/src/components/views/rooms/MessageComposer.js @@ -20,7 +20,7 @@ import { _t } from '../../../languageHandler'; import CallHandler from '../../../CallHandler'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; import * as sdk from '../../../index'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import RoomViewStore from '../../../stores/RoomViewStore'; import Stickerpicker from './Stickerpicker'; import { makeRoomPermalink } from '../../../utils/permalinks/Permalinks'; diff --git a/src/components/views/rooms/PinnedEventTile.js b/src/components/views/rooms/PinnedEventTile.js index 28fc8fc338..924385d226 100644 --- a/src/components/views/rooms/PinnedEventTile.js +++ b/src/components/views/rooms/PinnedEventTile.js @@ -18,7 +18,7 @@ import React from "react"; import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; import {MatrixClientPeg} from "../../../MatrixClientPeg"; -import dis from "../../../dispatcher"; +import dis from "../../../dispatcher/dispatcher"; import AccessibleButton from "../elements/AccessibleButton"; import MessageEvent from "../messages/MessageEvent"; import MemberAvatar from "../avatars/MemberAvatar"; diff --git a/src/components/views/rooms/ReplyPreview.js b/src/components/views/rooms/ReplyPreview.js index b28494c65a..e7cd2b4c0d 100644 --- a/src/components/views/rooms/ReplyPreview.js +++ b/src/components/views/rooms/ReplyPreview.js @@ -15,7 +15,7 @@ limitations under the License. */ import React from 'react'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; import RoomViewStore from '../../../stores/RoomViewStore'; diff --git a/src/components/views/rooms/RoomBreadcrumbs.js b/src/components/views/rooms/RoomBreadcrumbs.js index 86c0d7ca96..fe443d720f 100644 --- a/src/components/views/rooms/RoomBreadcrumbs.js +++ b/src/components/views/rooms/RoomBreadcrumbs.js @@ -15,7 +15,7 @@ limitations under the License. */ import React, {createRef} from "react"; -import dis from "../../../dispatcher"; +import dis from "../../../dispatcher/dispatcher"; import {MatrixClientPeg} from "../../../MatrixClientPeg"; import SettingsStore, {SettingLevel} from "../../../settings/SettingsStore"; import AccessibleButton from '../elements/AccessibleButton'; diff --git a/src/components/views/rooms/RoomDetailList.js b/src/components/views/rooms/RoomDetailList.js index db7b86da4f..5b45cfc29a 100644 --- a/src/components/views/rooms/RoomDetailList.js +++ b/src/components/views/rooms/RoomDetailList.js @@ -15,7 +15,7 @@ limitations under the License. */ import * as sdk from '../../../index'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import React from 'react'; import { _t } from '../../../languageHandler'; import PropTypes from 'prop-types'; diff --git a/src/components/views/rooms/RoomList.js b/src/components/views/rooms/RoomList.js index 289a89a206..1c59a5d8d0 100644 --- a/src/components/views/rooms/RoomList.js +++ b/src/components/views/rooms/RoomList.js @@ -35,7 +35,7 @@ import GroupStore from '../../../stores/GroupStore'; import RoomSubList from '../../structures/RoomSubList'; import ResizeHandle from '../elements/ResizeHandle'; import CallHandler from "../../../CallHandler"; -import dis from "../../../dispatcher"; +import dis from "../../../dispatcher/dispatcher"; import * as sdk from "../../../index"; import * as Receipt from "../../../utils/Receipt"; import {Resizer} from '../../../resizer'; diff --git a/src/components/views/rooms/RoomPreviewBar.js b/src/components/views/rooms/RoomPreviewBar.js index fe7c57d811..30e6ae9c58 100644 --- a/src/components/views/rooms/RoomPreviewBar.js +++ b/src/components/views/rooms/RoomPreviewBar.js @@ -21,7 +21,7 @@ import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; import * as sdk from '../../../index'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import classNames from 'classnames'; import { _t } from '../../../languageHandler'; import IdentityAuthClient from '../../../IdentityAuthClient'; diff --git a/src/components/views/rooms/RoomTile.js b/src/components/views/rooms/RoomTile.js index 6a23fe309b..44e5ae7643 100644 --- a/src/components/views/rooms/RoomTile.js +++ b/src/components/views/rooms/RoomTile.js @@ -21,7 +21,7 @@ import React, {createRef} from 'react'; import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; import classNames from 'classnames'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; import DMRoomMap from '../../../utils/DMRoomMap'; import * as sdk from '../../../index'; diff --git a/src/components/views/rooms/SendMessageComposer.js b/src/components/views/rooms/SendMessageComposer.js index 233bb110be..5ea979a8ef 100644 --- a/src/components/views/rooms/SendMessageComposer.js +++ b/src/components/views/rooms/SendMessageComposer.js @@ -16,7 +16,7 @@ limitations under the License. */ import React from 'react'; import PropTypes from 'prop-types'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import EditorModel from '../../../editor/model'; import { htmlSerializeIfNeeded, diff --git a/src/components/views/rooms/Stickerpicker.js b/src/components/views/rooms/Stickerpicker.js index 9d91ab04b3..fc6e80fc61 100644 --- a/src/components/views/rooms/Stickerpicker.js +++ b/src/components/views/rooms/Stickerpicker.js @@ -18,7 +18,7 @@ import {_t, _td} from '../../../languageHandler'; import AppTile from '../elements/AppTile'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; import * as sdk from '../../../index'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import AccessibleButton from '../elements/AccessibleButton'; import WidgetUtils from '../../../utils/WidgetUtils'; import ActiveWidgetStore from '../../../stores/ActiveWidgetStore'; diff --git a/src/components/views/rooms/ThirdPartyMemberInfo.js b/src/components/views/rooms/ThirdPartyMemberInfo.js index 3e6ed16aa4..3a7042ebd2 100644 --- a/src/components/views/rooms/ThirdPartyMemberInfo.js +++ b/src/components/views/rooms/ThirdPartyMemberInfo.js @@ -19,7 +19,7 @@ import PropTypes from 'prop-types'; import {MatrixClientPeg} from "../../../MatrixClientPeg"; import {MatrixEvent} from "matrix-js-sdk"; import {_t} from "../../../languageHandler"; -import dis from "../../../dispatcher"; +import dis from "../../../dispatcher/dispatcher"; import * as sdk from "../../../index"; import Modal from "../../../Modal"; import {isValid3pidInvite} from "../../../RoomInvite"; diff --git a/src/components/views/settings/ChangePassword.js b/src/components/views/settings/ChangePassword.js index 7c88573e9c..c7eccf2145 100644 --- a/src/components/views/settings/ChangePassword.js +++ b/src/components/views/settings/ChangePassword.js @@ -20,7 +20,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; import {MatrixClientPeg} from "../../../MatrixClientPeg"; -import dis from "../../../dispatcher"; +import dis from "../../../dispatcher/dispatcher"; import AccessibleButton from '../elements/AccessibleButton'; import { _t } from '../../../languageHandler'; import * as sdk from "../../../index"; diff --git a/src/components/views/settings/EnableNotificationsButton.js b/src/components/views/settings/EnableNotificationsButton.js index 9ca591f30e..e4b348dfbd 100644 --- a/src/components/views/settings/EnableNotificationsButton.js +++ b/src/components/views/settings/EnableNotificationsButton.js @@ -17,7 +17,7 @@ limitations under the License. import React from "react"; import createReactClass from 'create-react-class'; import Notifier from "../../../Notifier"; -import dis from "../../../dispatcher"; +import dis from "../../../dispatcher/dispatcher"; import { _t } from '../../../languageHandler'; export default createReactClass({ diff --git a/src/components/views/settings/IntegrationManager.js b/src/components/views/settings/IntegrationManager.js index a5150e3777..fd6a62d73a 100644 --- a/src/components/views/settings/IntegrationManager.js +++ b/src/components/views/settings/IntegrationManager.js @@ -19,7 +19,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import {Key} from "../../../Keyboard"; export default class IntegrationManager extends React.Component { diff --git a/src/components/views/settings/SetIdServer.js b/src/components/views/settings/SetIdServer.js index cb37271452..23e72e2352 100644 --- a/src/components/views/settings/SetIdServer.js +++ b/src/components/views/settings/SetIdServer.js @@ -21,7 +21,7 @@ import {_t} from "../../../languageHandler"; import * as sdk from '../../../index'; import {MatrixClientPeg} from "../../../MatrixClientPeg"; import Modal from '../../../Modal'; -import dis from "../../../dispatcher"; +import dis from "../../../dispatcher/dispatcher"; import { getThreepidsWithBindStatus } from '../../../boundThreepids'; import IdentityAuthClient from "../../../IdentityAuthClient"; import {abbreviateUrl, unabbreviateUrl} from "../../../utils/UrlUtils"; diff --git a/src/components/views/settings/tabs/room/AdvancedRoomSettingsTab.js b/src/components/views/settings/tabs/room/AdvancedRoomSettingsTab.js index 9ee9c8d130..f57d5d3798 100644 --- a/src/components/views/settings/tabs/room/AdvancedRoomSettingsTab.js +++ b/src/components/views/settings/tabs/room/AdvancedRoomSettingsTab.js @@ -21,7 +21,7 @@ import {MatrixClientPeg} from "../../../../../MatrixClientPeg"; import * as sdk from "../../../../.."; import AccessibleButton from "../../../elements/AccessibleButton"; import Modal from "../../../../../Modal"; -import dis from "../../../../../dispatcher"; +import dis from "../../../../../dispatcher/dispatcher"; export default class AdvancedRoomSettingsTab extends React.Component { static propTypes = { diff --git a/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.js b/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.js index 99882ae400..1f12396413 100644 --- a/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.js +++ b/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.js @@ -20,7 +20,7 @@ import {_t} from "../../../../../languageHandler"; import RoomProfileSettings from "../../../room_settings/RoomProfileSettings"; import * as sdk from "../../../../.."; import AccessibleButton from "../../../elements/AccessibleButton"; -import dis from "../../../../../dispatcher"; +import dis from "../../../../../dispatcher/dispatcher"; import MatrixClientContext from "../../../../../contexts/MatrixClientContext"; export default class GeneralRoomSettingsTab extends React.Component { diff --git a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js index 867982ad2b..216bffc3ed 100644 --- a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js +++ b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js @@ -32,7 +32,7 @@ import PlatformPeg from "../../../../../PlatformPeg"; import {MatrixClientPeg} from "../../../../../MatrixClientPeg"; import * as sdk from "../../../../.."; import Modal from "../../../../../Modal"; -import dis from "../../../../../dispatcher"; +import dis from "../../../../../dispatcher/dispatcher"; import {Service, startTermsFlow} from "../../../../../Terms"; import {SERVICE_TYPES} from "matrix-js-sdk"; import IdentityAuthClient from "../../../../../IdentityAuthClient"; diff --git a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js index 5dd6475e6e..bed057f03d 100644 --- a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js +++ b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js @@ -25,7 +25,7 @@ import Analytics from "../../../../../Analytics"; import Modal from "../../../../../Modal"; import * as sdk from "../../../../.."; import {sleep} from "../../../../../utils/promise"; -import dis from "../../../../../dispatcher"; +import dis from "../../../../../dispatcher/dispatcher"; export class IgnoredUser extends React.Component { static propTypes = { diff --git a/src/components/views/toasts/BulkUnverifiedSessionsToast.js b/src/components/views/toasts/BulkUnverifiedSessionsToast.js index 0c40e56858..99ff529c35 100644 --- a/src/components/views/toasts/BulkUnverifiedSessionsToast.js +++ b/src/components/views/toasts/BulkUnverifiedSessionsToast.js @@ -17,7 +17,7 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; import { _t } from '../../../languageHandler'; -import dis from "../../../dispatcher"; +import dis from "../../../dispatcher/dispatcher"; import { MatrixClientPeg } from '../../../MatrixClientPeg'; import DeviceListener from '../../../DeviceListener'; import FormButton from '../elements/FormButton'; diff --git a/src/components/views/toasts/VerificationRequestToast.js b/src/components/views/toasts/VerificationRequestToast.js index 6447e87627..421dd7bea1 100644 --- a/src/components/views/toasts/VerificationRequestToast.js +++ b/src/components/views/toasts/VerificationRequestToast.js @@ -21,7 +21,7 @@ import { _t } from '../../../languageHandler'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; import {RIGHT_PANEL_PHASES} from "../../../stores/RightPanelStorePhases"; import {userLabelForEventRoom} from "../../../utils/KeyVerificationStateObserver"; -import dis from "../../../dispatcher"; +import dis from "../../../dispatcher/dispatcher"; import ToastStore from "../../../stores/ToastStore"; import Modal from "../../../Modal"; diff --git a/src/components/views/voip/CallPreview.js b/src/components/views/voip/CallPreview.js index 049dd8a3c6..c465170950 100644 --- a/src/components/views/voip/CallPreview.js +++ b/src/components/views/voip/CallPreview.js @@ -20,7 +20,7 @@ import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; import RoomViewStore from '../../../stores/RoomViewStore'; import CallHandler from '../../../CallHandler'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import * as sdk from '../../../index'; export default createReactClass({ diff --git a/src/components/views/voip/CallView.js b/src/components/views/voip/CallView.js index 4a5f3923e2..a0a566dfac 100644 --- a/src/components/views/voip/CallView.js +++ b/src/components/views/voip/CallView.js @@ -17,7 +17,7 @@ limitations under the License. import React, {createRef} from 'react'; import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import CallHandler from '../../../CallHandler'; import * as sdk from '../../../index'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; diff --git a/src/components/views/voip/IncomingCallBox.js b/src/components/views/voip/IncomingCallBox.js index 53e829b784..bf28fa0157 100644 --- a/src/components/views/voip/IncomingCallBox.js +++ b/src/components/views/voip/IncomingCallBox.js @@ -19,7 +19,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import { _t } from '../../../languageHandler'; import * as sdk from '../../../index'; diff --git a/src/components/views/voip/VideoView.js b/src/components/views/voip/VideoView.js index 51be6db81d..a51ab70da9 100644 --- a/src/components/views/voip/VideoView.js +++ b/src/components/views/voip/VideoView.js @@ -22,7 +22,7 @@ import createReactClass from 'create-react-class'; import classNames from 'classnames'; import * as sdk from '../../../index'; -import dis from '../../../dispatcher'; +import dis from '../../../dispatcher/dispatcher'; import SettingsStore from "../../../settings/SettingsStore"; diff --git a/src/createRoom.js b/src/createRoom.js index a39d2c2216..18fc787e1c 100644 --- a/src/createRoom.js +++ b/src/createRoom.js @@ -19,7 +19,7 @@ import {MatrixClientPeg} from './MatrixClientPeg'; import Modal from './Modal'; import * as sdk from './index'; import { _t } from './languageHandler'; -import dis from "./dispatcher"; +import dis from "./dispatcher/dispatcher"; import * as Rooms from "./Rooms"; import DMRoomMap from "./utils/DMRoomMap"; import {getAddressType} from "./UserAddress"; diff --git a/src/cryptodevices.js b/src/cryptodevices.js index f56a80e1e4..86b97364f9 100644 --- a/src/cryptodevices.js +++ b/src/cryptodevices.js @@ -16,7 +16,7 @@ limitations under the License. import Resend from './Resend'; import * as sdk from './index'; -import dis from './dispatcher'; +import dis from './dispatcher/dispatcher'; import Modal from './Modal'; import { _t } from './languageHandler'; diff --git a/src/dispatcher.ts b/src/dispatcher/dispatcher.ts similarity index 100% rename from src/dispatcher.ts rename to src/dispatcher/dispatcher.ts diff --git a/src/mjolnir/Mjolnir.js b/src/mjolnir/Mjolnir.js index 5836ffd57a..9876cb1f7f 100644 --- a/src/mjolnir/Mjolnir.js +++ b/src/mjolnir/Mjolnir.js @@ -18,7 +18,7 @@ import {MatrixClientPeg} from "../MatrixClientPeg"; import {ALL_RULE_TYPES, BanList} from "./BanList"; import SettingsStore, {SettingLevel} from "../settings/SettingsStore"; import {_t} from "../languageHandler"; -import dis from "../dispatcher"; +import dis from "../dispatcher/dispatcher"; // TODO: Move this and related files to the js-sdk or something once finalized. diff --git a/src/settings/SettingsStore.js b/src/settings/SettingsStore.js index 0122916bc3..36111dd46f 100644 --- a/src/settings/SettingsStore.js +++ b/src/settings/SettingsStore.js @@ -24,7 +24,7 @@ import RoomSettingsHandler from "./handlers/RoomSettingsHandler"; import ConfigSettingsHandler from "./handlers/ConfigSettingsHandler"; import {_t} from '../languageHandler'; import SdkConfig from "../SdkConfig"; -import dis from '../dispatcher'; +import dis from '../dispatcher/dispatcher'; import {SETTINGS} from "./Settings"; import LocalEchoWrapper from "./handlers/LocalEchoWrapper"; import {WatchManager} from "./WatchManager"; diff --git a/src/settings/controllers/CustomStatusController.js b/src/settings/controllers/CustomStatusController.js index 0fc6619d92..031387bb6a 100644 --- a/src/settings/controllers/CustomStatusController.js +++ b/src/settings/controllers/CustomStatusController.js @@ -15,7 +15,7 @@ limitations under the License. */ import SettingController from "./SettingController"; -import dis from "../../dispatcher"; +import dis from "../../dispatcher/dispatcher"; export default class CustomStatusController extends SettingController { onChange(level, roomId, newValue) { diff --git a/src/stores/CustomRoomTagStore.js b/src/stores/CustomRoomTagStore.js index 909282c085..c67868e2c6 100644 --- a/src/stores/CustomRoomTagStore.js +++ b/src/stores/CustomRoomTagStore.js @@ -13,7 +13,7 @@ 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 dis from '../dispatcher'; +import dis from '../dispatcher/dispatcher'; import * as RoomNotifs from '../RoomNotifs'; import RoomListStore from './RoomListStore'; import EventEmitter from 'events'; diff --git a/src/stores/GroupStore.js b/src/stores/GroupStore.js index 78a144f755..d4097184a1 100644 --- a/src/stores/GroupStore.js +++ b/src/stores/GroupStore.js @@ -18,7 +18,7 @@ import EventEmitter from 'events'; import { groupMemberFromApiObject, groupRoomFromApiObject } from '../groups'; import FlairStore from './FlairStore'; import {MatrixClientPeg} from '../MatrixClientPeg'; -import dis from '../dispatcher'; +import dis from '../dispatcher/dispatcher'; function parseMembersResponse(response) { return response.chunk.map((apiMember) => groupMemberFromApiObject(apiMember)); diff --git a/src/stores/LifecycleStore.js b/src/stores/LifecycleStore.js index 904f29f7b3..a12bac7dd6 100644 --- a/src/stores/LifecycleStore.js +++ b/src/stores/LifecycleStore.js @@ -15,7 +15,7 @@ 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 dis from '../dispatcher'; +import dis from '../dispatcher/dispatcher'; import {Store} from 'flux/utils'; const INITIAL_STATE = { diff --git a/src/stores/RightPanelStore.js b/src/stores/RightPanelStore.js index 3a5605ba3f..a73f3befbb 100644 --- a/src/stores/RightPanelStore.js +++ b/src/stores/RightPanelStore.js @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import dis from '../dispatcher'; +import dis from '../dispatcher/dispatcher'; import {pendingVerificationRequestForUser} from '../verification'; import {Store} from 'flux/utils'; import SettingsStore, {SettingLevel} from "../settings/SettingsStore"; diff --git a/src/stores/RoomListStore.js b/src/stores/RoomListStore.js index 89edc9a8ef..d7b6759195 100644 --- a/src/stores/RoomListStore.js +++ b/src/stores/RoomListStore.js @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ import {Store} from 'flux/utils'; -import dis from '../dispatcher'; +import dis from '../dispatcher/dispatcher'; import DMRoomMap from '../utils/DMRoomMap'; import * as Unread from '../Unread'; import SettingsStore from "../settings/SettingsStore"; diff --git a/src/stores/RoomViewStore.js b/src/stores/RoomViewStore.js index 841734dfb7..3d82d086d7 100644 --- a/src/stores/RoomViewStore.js +++ b/src/stores/RoomViewStore.js @@ -15,7 +15,7 @@ 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 dis from '../dispatcher'; +import dis from '../dispatcher/dispatcher'; import {Store} from 'flux/utils'; import {MatrixClientPeg} from '../MatrixClientPeg'; import * as sdk from '../index'; diff --git a/src/stores/SessionStore.js b/src/stores/SessionStore.js index f38bc046d0..096811940c 100644 --- a/src/stores/SessionStore.js +++ b/src/stores/SessionStore.js @@ -14,7 +14,7 @@ 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 dis from '../dispatcher'; +import dis from '../dispatcher/dispatcher'; import {Store} from 'flux/utils'; const INITIAL_STATE = { diff --git a/src/stores/TagOrderStore.js b/src/stores/TagOrderStore.js index c05728e497..2acf531d86 100644 --- a/src/stores/TagOrderStore.js +++ b/src/stores/TagOrderStore.js @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ import {Store} from 'flux/utils'; -import dis from '../dispatcher'; +import dis from '../dispatcher/dispatcher'; import GroupStore from './GroupStore'; import Analytics from '../Analytics'; import * as RoomNotifs from "../RoomNotifs"; diff --git a/src/theme.js b/src/theme.js index 2ccce81a8d..1da39d50fa 100644 --- a/src/theme.js +++ b/src/theme.js @@ -19,7 +19,7 @@ import {_t} from "./languageHandler"; export const DEFAULT_THEME = "light"; import Tinter from "./Tinter"; -import dis from "./dispatcher"; +import dis from "./dispatcher/dispatcher"; import SettingsStore, {SettingLevel} from "./settings/SettingsStore"; import ThemeController from "./settings/controllers/ThemeController"; diff --git a/src/utils/WidgetUtils.js b/src/utils/WidgetUtils.js index ad4c02887e..35e23f0429 100644 --- a/src/utils/WidgetUtils.js +++ b/src/utils/WidgetUtils.js @@ -18,7 +18,7 @@ limitations under the License. import {MatrixClientPeg} from '../MatrixClientPeg'; import SdkConfig from "../SdkConfig"; -import dis from '../dispatcher'; +import dis from '../dispatcher/dispatcher'; import * as url from "url"; import WidgetEchoStore from '../stores/WidgetEchoStore'; diff --git a/src/verification.js b/src/verification.js index f488b2ebeb..289ac9544b 100644 --- a/src/verification.js +++ b/src/verification.js @@ -15,7 +15,7 @@ limitations under the License. */ import {MatrixClientPeg} from './MatrixClientPeg'; -import dis from "./dispatcher"; +import dis from "./dispatcher/dispatcher"; import Modal from './Modal'; import * as sdk from './index'; import { _t } from './languageHandler'; diff --git a/test/components/views/rooms/RoomList-test.js b/test/components/views/rooms/RoomList-test.js index 8dc4647920..235ed61016 100644 --- a/test/components/views/rooms/RoomList-test.js +++ b/test/components/views/rooms/RoomList-test.js @@ -9,7 +9,7 @@ import {MatrixClientPeg} from '../../../../src/MatrixClientPeg'; import sdk from '../../../skinned-sdk'; import { DragDropContext } from 'react-beautiful-dnd'; -import dis from '../../../../src/dispatcher'; +import dis from '../../../../src/dispatcher/dispatcher'; import DMRoomMap from '../../../../src/utils/DMRoomMap.js'; import GroupStore from '../../../../src/stores/GroupStore.js'; diff --git a/test/test-utils.js b/test/test-utils.js index d7aa9d5de9..2d7c1bd62c 100644 --- a/test/test-utils.js +++ b/test/test-utils.js @@ -2,7 +2,7 @@ import React from 'react'; import {MatrixClientPeg as peg} from '../src/MatrixClientPeg'; -import dis from '../src/dispatcher'; +import dis from '../src/dispatcher/dispatcher'; import {makeType} from "../src/utils/TypeUtils"; import {ValidatedServerConfig} from "../src/utils/AutoDiscoveryUtils"; import ShallowRenderer from 'react-test-renderer/shallow'; From 8c72c27da9afe371e15f2f010d61fe4608c788c1 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 13 May 2020 20:46:00 -0600 Subject: [PATCH 27/86] Break out actions and payloads to their own files The definitions take up a lot of space which makes it hard to see the dispatcher class, so break them out. --- src/actions/RoomListActions.ts | 2 +- src/actions/TagOrderActions.ts | 2 +- src/actions/actionCreators.ts | 2 +- src/dispatcher/actions.ts | 23 +++++++++++++ src/dispatcher/dispatcher.ts | 51 ++--------------------------- src/dispatcher/payloads.ts | 59 ++++++++++++++++++++++++++++++++++ 6 files changed, 87 insertions(+), 52 deletions(-) create mode 100644 src/dispatcher/actions.ts create mode 100644 src/dispatcher/payloads.ts diff --git a/src/actions/RoomListActions.ts b/src/actions/RoomListActions.ts index 0cdd3a86d8..eb9831ec47 100644 --- a/src/actions/RoomListActions.ts +++ b/src/actions/RoomListActions.ts @@ -23,7 +23,7 @@ import { _t } from '../languageHandler'; import * as sdk from '../index'; import { MatrixClient } from "matrix-js-sdk/src/client"; import { Room } from "matrix-js-sdk/src/models/room"; -import { AsyncActionPayload } from "../dispatcher/dispatcher"; +import { AsyncActionPayload } from "../dispatcher/payloads"; export default class RoomListActions { /** diff --git a/src/actions/TagOrderActions.ts b/src/actions/TagOrderActions.ts index fa86e3a6b1..fa95ea1037 100644 --- a/src/actions/TagOrderActions.ts +++ b/src/actions/TagOrderActions.ts @@ -18,7 +18,7 @@ limitations under the License. import Analytics from '../Analytics'; import { asyncAction } from './actionCreators'; import TagOrderStore from '../stores/TagOrderStore'; -import { AsyncActionPayload } from "../dispatcher/dispatcher"; +import { AsyncActionPayload } from "../dispatcher/payloads"; import { MatrixClient } from "matrix-js-sdk/src/client"; export default class TagOrderActions { diff --git a/src/actions/actionCreators.ts b/src/actions/actionCreators.ts index 78525a9509..d84868a141 100644 --- a/src/actions/actionCreators.ts +++ b/src/actions/actionCreators.ts @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { AsyncActionPayload } from "../dispatcher/dispatcher"; +import { AsyncActionPayload } from "../dispatcher/payloads"; /** * Create an action thunk that will dispatch actions indicating the current diff --git a/src/dispatcher/actions.ts b/src/dispatcher/actions.ts new file mode 100644 index 0000000000..ff1650e4e5 --- /dev/null +++ b/src/dispatcher/actions.ts @@ -0,0 +1,23 @@ +/* +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. +*/ + +// Dispatcher actions also extend into any arbitrary string, so support that. +export type DispatcherAction = Action | string; + +export enum Action { + // TODO: Populate with actual actions +} + diff --git a/src/dispatcher/dispatcher.ts b/src/dispatcher/dispatcher.ts index fce99df055..6ef165c485 100644 --- a/src/dispatcher/dispatcher.ts +++ b/src/dispatcher/dispatcher.ts @@ -17,55 +17,8 @@ limitations under the License. */ import { Dispatcher } from "flux"; - -export enum Action { - // TODO: Populate with actual actions -} - -// Dispatcher actions also extend into any arbitrary string, so support that. -export type DispatcherAction = Action | string; - -/** - * The base dispatch type exposed by our dispatcher. - */ -export interface ActionPayload { - [property: string]: any; // effectively makes this 'extends Object' - action: DispatcherAction; -} - -/** - * The function the dispatcher calls when ready for an AsyncActionPayload. The - * single argument is used to start a dispatch. First the dispatcher calls the - * outer function, then when the called function is ready it calls the cb - * function to issue the dispatch. It may call the callback repeatedly if needed. - */ -export type AsyncActionFn = (cb: (action: ActionPayload) => void) => void; - -/** - * An async version of ActionPayload - */ -export class AsyncActionPayload implements ActionPayload { - /** - * The function the dispatcher should call. - */ - public readonly fn: AsyncActionFn; - - /** - * @deprecated Not used on AsyncActionPayload. - */ - public get action(): DispatcherAction { - return "NOT_USED"; - } - - /** - * Create a new AsyncActionPayload with the given ready function. - * @param {AsyncActionFn} readyFn The function to be called when the - * dispatcher is ready. - */ - public constructor(readyFn: AsyncActionFn) { - this.fn = readyFn; - } -} +import { Action } from "./actions"; +import { ActionPayload, AsyncActionPayload } from "./payloads"; /** * A dispatcher for ActionPayloads (the default within the SDK). diff --git a/src/dispatcher/payloads.ts b/src/dispatcher/payloads.ts new file mode 100644 index 0000000000..fa45b30623 --- /dev/null +++ b/src/dispatcher/payloads.ts @@ -0,0 +1,59 @@ +/* +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 { DispatcherAction } from "./actions"; + +/** + * The base dispatch type exposed by our dispatcher. + */ +export interface ActionPayload { + [property: string]: any; // effectively makes this 'extends Object' + action: DispatcherAction; +} + +/** + * The function the dispatcher calls when ready for an AsyncActionPayload. The + * single argument is used to start a dispatch. First the dispatcher calls the + * outer function, then when the called function is ready it calls the cb + * function to issue the dispatch. It may call the callback repeatedly if needed. + */ +export type AsyncActionFn = (cb: (action: ActionPayload) => void) => void; + +/** + * An async version of ActionPayload + */ +export class AsyncActionPayload implements ActionPayload { + /** + * The function the dispatcher should call. + */ + public readonly fn: AsyncActionFn; + + /** + * @deprecated Not used on AsyncActionPayload. + */ + public get action(): DispatcherAction { + return "NOT_USED"; + } + + /** + * Create a new AsyncActionPayload with the given ready function. + * @param {AsyncActionFn} readyFn The function to be called when the + * dispatcher is ready. + */ + public constructor(readyFn: AsyncActionFn) { + this.fn = readyFn; + } +} From a3b4c2dfa02d1ae5ee959eaaa59e6544a0cea6d1 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 13 May 2020 20:48:49 -0600 Subject: [PATCH 28/86] Convert more async actions to AsyncActionPayload --- src/actions/GroupActions.js | 34 ---------------------------------- src/actions/GroupActions.ts | 34 ++++++++++++++++++++++++++++++++++ src/actions/TagOrderActions.ts | 3 +-- src/actions/actionCreators.ts | 5 ++--- 4 files changed, 37 insertions(+), 39 deletions(-) delete mode 100644 src/actions/GroupActions.js create mode 100644 src/actions/GroupActions.ts diff --git a/src/actions/GroupActions.js b/src/actions/GroupActions.js deleted file mode 100644 index 006c2da5b8..0000000000 --- a/src/actions/GroupActions.js +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright 2017 New Vector Ltd - -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 { asyncAction } from './actionCreators'; - -const GroupActions = {}; - -/** - * Creates an action thunk that will do an asynchronous request to fetch - * the groups to which a user is joined. - * - * @param {MatrixClient} matrixClient the matrix client to query. - * @returns {function} an action thunk that will dispatch actions - * indicating the status of the request. - * @see asyncAction - */ -GroupActions.fetchJoinedGroups = function(matrixClient) { - return asyncAction('GroupActions.fetchJoinedGroups', () => matrixClient.getJoinedGroups()); -}; - -export default GroupActions; diff --git a/src/actions/GroupActions.ts b/src/actions/GroupActions.ts new file mode 100644 index 0000000000..81470d1221 --- /dev/null +++ b/src/actions/GroupActions.ts @@ -0,0 +1,34 @@ +/* +Copyright 2017 New Vector Ltd +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 { asyncAction } from './actionCreators'; +import { AsyncActionPayload } from "../dispatcher/payloads"; +import { MatrixClient } from "matrix-js-sdk/src/client"; + +export default class GroupActions { + /** + * Creates an action thunk that will do an asynchronous request to fetch + * the groups to which a user is joined. + * + * @param {MatrixClient} matrixClient the matrix client to query. + * @returns {AsyncActionPayload} An async action payload. + * @see asyncAction + */ + public static fetchJoinedGroups(matrixClient: MatrixClient): AsyncActionPayload { + return asyncAction('GroupActions.fetchJoinedGroups', () => matrixClient.getJoinedGroups(), null); + } +} diff --git a/src/actions/TagOrderActions.ts b/src/actions/TagOrderActions.ts index fa95ea1037..bf1820d5d1 100644 --- a/src/actions/TagOrderActions.ts +++ b/src/actions/TagOrderActions.ts @@ -90,8 +90,7 @@ export default class TagOrderActions { if (removedTags.includes(tag)) { // Return a thunk that doesn't do anything, we don't even need // an asynchronous action here, the tag is already removed. - return () => { - }; + return new AsyncActionPayload(() => {}); } removedTags.push(tag); diff --git a/src/actions/actionCreators.ts b/src/actions/actionCreators.ts index d84868a141..c789e3cd07 100644 --- a/src/actions/actionCreators.ts +++ b/src/actions/actionCreators.ts @@ -44,12 +44,11 @@ import { AsyncActionPayload } from "../dispatcher/payloads"; * result is the result of the promise returned by * `fn`. */ -export function asyncAction(id: string, fn: () => Promise, pendingFn: () => any): AsyncActionPayload { +export function asyncAction(id: string, fn: () => Promise, pendingFn: () => any | null): AsyncActionPayload { const helper = (dispatch) => { dispatch({ action: id + '.pending', - request: - typeof pendingFn === 'function' ? pendingFn() : undefined, + request: typeof pendingFn === 'function' ? pendingFn() : undefined, }); fn().then((result) => { dispatch({action: id + '.success', result}); From a5f3318f3bec7d66c20a862669c3c1b938b362a6 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 13 May 2020 21:03:12 -0600 Subject: [PATCH 29/86] Convert view_user dispatch to prove the conversion works This is a relatively obvious dispatch action that doesn't require a lot of complicated type definitions, so should be a good candidate to prove the thing works. If for some reason the thing stops working, we've done something wrong. This also adds a bit of generic types to the dispatch call so we don't confuse the tsx parser by using `dis.dispatch({...})` as it thinks that's supposed to be a component. We still get type safety, and the thing remains happy with the generics approach. --- src/SlashCommands.tsx | 8 +++-- src/components/structures/MatrixChat.tsx | 26 ++++++++--------- src/components/structures/RightPanel.js | 5 ++-- src/components/views/avatars/MemberAvatar.js | 5 ++-- src/components/views/elements/Pill.js | 3 +- .../views/groups/GroupMemberInfo.js | 5 ++-- .../views/right_panel/GroupHeaderButtons.js | 6 ++-- .../views/right_panel/RoomHeaderButtons.js | 6 ++-- src/components/views/right_panel/UserInfo.js | 3 +- src/components/views/rooms/MemberInfo.js | 3 +- src/components/views/rooms/MemberTile.js | 3 +- src/dispatcher/actions.ts | 14 +++++++++ src/dispatcher/dispatcher.ts | 2 +- src/dispatcher/payloads/ViewUserPayload.ts | 29 +++++++++++++++++++ 14 files changed, 88 insertions(+), 30 deletions(-) create mode 100644 src/dispatcher/payloads/ViewUserPayload.ts diff --git a/src/SlashCommands.tsx b/src/SlashCommands.tsx index fd157b2b4c..d81da80e8d 100644 --- a/src/SlashCommands.tsx +++ b/src/SlashCommands.tsx @@ -41,6 +41,8 @@ import { parseFragment as parseHtml } from "parse5"; import sendBugReport from "./rageshake/submit-rageshake"; import SdkConfig from "./SdkConfig"; import { ensureDMExists } from "./createRoom"; +import { ViewUserPayload } from "./dispatcher/payloads/ViewUserPayload"; +import { Action } from "./dispatcher/actions"; // XXX: workaround for https://github.com/microsoft/TypeScript/issues/31816 interface HTMLInputEvent extends Event { @@ -943,8 +945,10 @@ export const Commands = [ } const member = MatrixClientPeg.get().getRoom(roomId).getMember(userId); - dis.dispatch({ - action: 'view_user', + dis.dispatch({ + action: Action.ViewUser, + // XXX: We should be using a real member object and not assuming what the + // receiver wants. member: member || {userId}, }); return success(); diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 973d301420..d368b2c23a 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -17,12 +17,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React, {createRef} from 'react'; -import {InvalidStoreError} from "matrix-js-sdk/src/errors"; -import {RoomMember} from "matrix-js-sdk/src/models/room-member"; -import {MatrixEvent} from "matrix-js-sdk/src/models/event"; +import React, { createRef } from 'react'; +import { InvalidStoreError } from "matrix-js-sdk/src/errors"; +import { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { isCryptoAvailable } from 'matrix-js-sdk/src/crypto'; - // focus-visible is a Polyfill for the :focus-visible CSS pseudo-attribute used by _AccessibleButton.scss import 'focus-visible'; // what-input helps improve keyboard accessibility @@ -30,7 +29,7 @@ import 'what-input'; import Analytics from "../../Analytics"; import { DecryptionFailureTracker } from "../../DecryptionFailureTracker"; -import {MatrixClientPeg} from "../../MatrixClientPeg"; +import { MatrixClientPeg } from "../../MatrixClientPeg"; import PlatformPeg from "../../PlatformPeg"; import SdkConfig from "../../SdkConfig"; import * as RoomListSorter from "../../RoomListSorter"; @@ -40,7 +39,7 @@ import Notifier from '../../Notifier'; import Modal from "../../Modal"; import Tinter from "../../Tinter"; import * as sdk from '../../index'; -import { showStartChatInviteDialog, showRoomInviteDialog } from '../../RoomInvite'; +import { showRoomInviteDialog, showStartChatInviteDialog } from '../../RoomInvite'; import * as Rooms from '../../Rooms'; import linkifyMatrix from "../../linkify-matrix"; import * as Lifecycle from '../../Lifecycle'; @@ -52,21 +51,22 @@ import { getHomePageUrl } from '../../utils/pages'; import createRoom from "../../createRoom"; import KeyRequestHandler from '../../KeyRequestHandler'; import { _t, getCurrentLanguage } from '../../languageHandler'; -import SettingsStore, {SettingLevel} from "../../settings/SettingsStore"; +import SettingsStore, { SettingLevel } from "../../settings/SettingsStore"; import ThemeController from "../../settings/controllers/ThemeController"; import { startAnyRegistrationFlow } from "../../Registration.js"; import { messageForSyncError } from '../../utils/ErrorUtils'; import ResizeNotifier from "../../utils/ResizeNotifier"; -import { ValidatedServerConfig } from "../../utils/AutoDiscoveryUtils"; -import AutoDiscoveryUtils from "../../utils/AutoDiscoveryUtils"; +import AutoDiscoveryUtils, { ValidatedServerConfig } from "../../utils/AutoDiscoveryUtils"; import DMRoomMap from '../../utils/DMRoomMap'; import { countRoomsWithNotif } from '../../RoomNotifs'; import { ThemeWatcher } from "../../theme"; import { storeRoomAliasInCache } from '../../RoomAliasCache'; -import {defer, IDeferred} from "../../utils/promise"; +import { defer, IDeferred } from "../../utils/promise"; import ToastStore from "../../stores/ToastStore"; import * as StorageManager from "../../utils/StorageManager"; import type LoggedInViewType from "./LoggedInView"; +import { ViewUserPayload } from "../../dispatcher/payloads/ViewUserPayload"; +import { Action } from "../../dispatcher/actions"; /** constants for MatrixChat.state.view */ export enum Views { @@ -1755,8 +1755,8 @@ export default class MatrixChat extends React.PureComponent { const member = new RoomMember(null, userId); if (!member) { return; } - dis.dispatch({ - action: 'view_user', + dis.dispatch({ + action: Action.ViewUser, member: member, }); } diff --git a/src/components/structures/RightPanel.js b/src/components/structures/RightPanel.js index c6c330a202..56cc92a8f8 100644 --- a/src/components/structures/RightPanel.js +++ b/src/components/structures/RightPanel.js @@ -30,6 +30,7 @@ import SettingsStore from "../../settings/SettingsStore"; import {RIGHT_PANEL_PHASES, RIGHT_PANEL_PHASES_NO_ARGS} from "../../stores/RightPanelStorePhases"; import RightPanelStore from "../../stores/RightPanelStore"; import MatrixClientContext from "../../contexts/MatrixClientContext"; +import {Action} from "../../dispatcher/actions"; export default class RightPanel extends React.Component { static get propTypes() { @@ -237,7 +238,7 @@ export default class RightPanel extends React.Component { // within a room, so go back to the member panel if we were in the encryption panel, // or the member list if we were in the member panel... phew. dis.dispatch({ - action: "view_user", + action: Action.ViewUser, member: this.state.phase === RIGHT_PANEL_PHASES.EncryptionPanel ? this.state.member : null, }); @@ -266,7 +267,7 @@ export default class RightPanel extends React.Component { if (SettingsStore.getValue("feature_cross_signing")) { const onClose = () => { dis.dispatch({ - action: "view_user", + action: Action.ViewUser, member: null, }); }; diff --git a/src/components/views/avatars/MemberAvatar.js b/src/components/views/avatars/MemberAvatar.js index 89314cfef7..d28d80e62a 100644 --- a/src/components/views/avatars/MemberAvatar.js +++ b/src/components/views/avatars/MemberAvatar.js @@ -21,6 +21,7 @@ import createReactClass from 'create-react-class'; import * as Avatar from '../../../Avatar'; import * as sdk from "../../../index"; import dis from "../../../dispatcher/dispatcher"; +import {Action} from "../../../dispatcher/actions"; export default createReactClass({ displayName: 'MemberAvatar', @@ -33,7 +34,7 @@ export default createReactClass({ resizeMethod: PropTypes.string, // The onClick to give the avatar onClick: PropTypes.func, - // Whether the onClick of the avatar should be overriden to dispatch 'view_user' + // Whether the onClick of the avatar should be overriden to dispatch `Action.ViewUser` viewUserOnClick: PropTypes.bool, title: PropTypes.string, }, @@ -85,7 +86,7 @@ export default createReactClass({ if (viewUserOnClick) { onClick = () => { dis.dispatch({ - action: 'view_user', + action: Action.ViewUser, member: this.props.member, }); }; diff --git a/src/components/views/elements/Pill.js b/src/components/views/elements/Pill.js index 3e4ddb99e8..03a1aeed85 100644 --- a/src/components/views/elements/Pill.js +++ b/src/components/views/elements/Pill.js @@ -26,6 +26,7 @@ import {MatrixClientPeg} from '../../../MatrixClientPeg'; import FlairStore from "../../../stores/FlairStore"; import {getPrimaryPermalinkEntity} from "../../../utils/permalinks/Permalinks"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; +import {Action} from "../../../dispatcher/actions"; // For URLs of matrix.to links in the timeline which have been reformatted by // HttpUtils transformTags to relative links. This excludes event URLs (with `[^\/]*`) @@ -191,7 +192,7 @@ const Pill = createReactClass({ onUserPillClicked: function() { dis.dispatch({ - action: 'view_user', + action: Action.ViewUser, member: this.state.member, }); }, diff --git a/src/components/views/groups/GroupMemberInfo.js b/src/components/views/groups/GroupMemberInfo.js index 0d08771676..2582cab573 100644 --- a/src/components/views/groups/GroupMemberInfo.js +++ b/src/components/views/groups/GroupMemberInfo.js @@ -28,6 +28,7 @@ import GroupStore from '../../../stores/GroupStore'; import AccessibleButton from '../elements/AccessibleButton'; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import AutoHideScrollbar from "../../structures/AutoHideScrollbar"; +import {Action} from "../../../dispatcher/actions"; export default createReactClass({ displayName: 'GroupMemberInfo', @@ -103,7 +104,7 @@ export default createReactClass({ ).then(() => { // return to the user list dis.dispatch({ - action: "view_user", + action: Action.ViewUser, member: null, }); }).catch((e) => { @@ -124,7 +125,7 @@ export default createReactClass({ _onCancel: function(e) { // Go back to the user list dis.dispatch({ - action: "view_user", + action: Action.ViewUser, member: null, }); }, diff --git a/src/components/views/right_panel/GroupHeaderButtons.js b/src/components/views/right_panel/GroupHeaderButtons.js index f164b6c578..33d9325433 100644 --- a/src/components/views/right_panel/GroupHeaderButtons.js +++ b/src/components/views/right_panel/GroupHeaderButtons.js @@ -23,6 +23,8 @@ import { _t } from '../../../languageHandler'; import HeaderButton from './HeaderButton'; import HeaderButtons, {HEADER_KIND_GROUP} from './HeaderButtons'; import {RIGHT_PANEL_PHASES} from "../../../stores/RightPanelStorePhases"; +import {Action} from "../../../dispatcher/actions"; +import {ActionPayload} from "../../../dispatcher/payloads"; const GROUP_PHASES = [ RIGHT_PANEL_PHASES.GroupMemberInfo, @@ -40,10 +42,10 @@ export default class GroupHeaderButtons extends HeaderButtons { this._onRoomsClicked = this._onRoomsClicked.bind(this); } - onAction(payload) { + onAction(payload: ActionPayload) { super.onAction(payload); - if (payload.action === "view_user") { + if (payload.action === Action.ViewUser) { if (payload.member) { this.setPhase(RIGHT_PANEL_PHASES.RoomMemberInfo, {member: payload.member}); } else { diff --git a/src/components/views/right_panel/RoomHeaderButtons.js b/src/components/views/right_panel/RoomHeaderButtons.js index bad89e2dbe..838727981d 100644 --- a/src/components/views/right_panel/RoomHeaderButtons.js +++ b/src/components/views/right_panel/RoomHeaderButtons.js @@ -23,6 +23,8 @@ import { _t } from '../../../languageHandler'; import HeaderButton from './HeaderButton'; import HeaderButtons, {HEADER_KIND_ROOM} from './HeaderButtons'; import {RIGHT_PANEL_PHASES} from "../../../stores/RightPanelStorePhases"; +import {Action} from "../../../dispatcher/actions"; +import {ActionPayload} from "../../../dispatcher/payloads"; const MEMBER_PHASES = [ RIGHT_PANEL_PHASES.RoomMemberList, @@ -39,9 +41,9 @@ export default class RoomHeaderButtons extends HeaderButtons { this._onNotificationsClicked = this._onNotificationsClicked.bind(this); } - onAction(payload) { + onAction(payload: ActionPayload) { super.onAction(payload); - if (payload.action === "view_user") { + if (payload.action === Action.ViewUser) { if (payload.member) { this.setPhase(RIGHT_PANEL_PHASES.RoomMemberInfo, {member: payload.member}); } else { diff --git a/src/components/views/right_panel/UserInfo.js b/src/components/views/right_panel/UserInfo.js index daf1a9490d..0392746c94 100644 --- a/src/components/views/right_panel/UserInfo.js +++ b/src/components/views/right_panel/UserInfo.js @@ -44,6 +44,7 @@ import {RIGHT_PANEL_PHASES} from "../../../stores/RightPanelStorePhases"; import EncryptionPanel from "./EncryptionPanel"; import { useAsyncMemo } from '../../../hooks/useAsyncMemo'; import { verifyUser, legacyVerifyUser, verifyDevice } from '../../../verification'; +import {Action} from "../../../dispatcher/actions"; const _disambiguateDevices = (devices) => { const names = Object.create(null); @@ -841,7 +842,7 @@ const GroupAdminToolsSection = ({children, groupId, groupMember, startUpdating, cli.removeUserFromGroup(groupId, groupMember.userId).then(() => { // return to the user list dis.dispatch({ - action: "view_user", + action: Action.ViewUser, member: null, }); }).catch((e) => { diff --git a/src/components/views/rooms/MemberInfo.js b/src/components/views/rooms/MemberInfo.js index 5d8e03a050..ed6c4ad748 100644 --- a/src/components/views/rooms/MemberInfo.js +++ b/src/components/views/rooms/MemberInfo.js @@ -48,6 +48,7 @@ import E2EIcon from "./E2EIcon"; import AutoHideScrollbar from "../../structures/AutoHideScrollbar"; import {MatrixClientPeg} from "../../../MatrixClientPeg"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; +import {Action} from "../../../dispatcher/actions"; export default createReactClass({ displayName: 'MemberInfo', @@ -724,7 +725,7 @@ export default createReactClass({ onCancel: function(e) { dis.dispatch({ - action: "view_user", + action: Action.ViewUser, member: null, }); }, diff --git a/src/components/views/rooms/MemberTile.js b/src/components/views/rooms/MemberTile.js index 6842e27ed3..2d290564c3 100644 --- a/src/components/views/rooms/MemberTile.js +++ b/src/components/views/rooms/MemberTile.js @@ -23,6 +23,7 @@ import * as sdk from "../../../index"; import dis from "../../../dispatcher/dispatcher"; import { _t } from '../../../languageHandler'; import { MatrixClientPeg } from "../../../MatrixClientPeg"; +import {Action} from "../../../dispatcher/actions"; export default createReactClass({ displayName: 'MemberTile', @@ -185,7 +186,7 @@ export default createReactClass({ onClick: function(e) { dis.dispatch({ - action: 'view_user', + action: Action.ViewUser, member: this.props.member, }); }, diff --git a/src/dispatcher/actions.ts b/src/dispatcher/actions.ts index ff1650e4e5..880e7e62cd 100644 --- a/src/dispatcher/actions.ts +++ b/src/dispatcher/actions.ts @@ -19,5 +19,19 @@ export type DispatcherAction = Action | string; export enum Action { // TODO: Populate with actual actions + // This is lazily generated as it also includes fixing a bunch of references. Work + // that we don't really want to take on in a giant chunk. We should always define + // new actions here, and ideally when we touch existing ones we take some time to + // define them correctly. + + // When defining a new action, please use lower_scored_case with an optional class + // name prefix. For example, `RoomListStore.view_room` or `view_user_settings`. + // New definitions should also receive an accompanying interface in the payloads + // directory. + + /** + * View a user's profile. Should be used with a ViewUserPayload. + */ + ViewUser = "view_user", } diff --git a/src/dispatcher/dispatcher.ts b/src/dispatcher/dispatcher.ts index 6ef165c485..8330e5cd19 100644 --- a/src/dispatcher/dispatcher.ts +++ b/src/dispatcher/dispatcher.ts @@ -32,7 +32,7 @@ export class MatrixDispatcher extends Dispatcher { * an operation that the browser requires user interaction * for. Default false (async). */ - dispatch(payload: ActionPayload, sync = false) { + dispatch(payload: T, sync = false) { if (payload instanceof AsyncActionPayload) { payload.fn((action: ActionPayload) => { this.dispatch(action, sync); diff --git a/src/dispatcher/payloads/ViewUserPayload.ts b/src/dispatcher/payloads/ViewUserPayload.ts new file mode 100644 index 0000000000..ed602d4e24 --- /dev/null +++ b/src/dispatcher/payloads/ViewUserPayload.ts @@ -0,0 +1,29 @@ +/* +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 { RoomMember } from "matrix-js-sdk/src/models/room-member"; +import { ActionPayload } from "../payloads"; +import { Action } from "../actions"; + +export interface ViewUserPayload extends ActionPayload { + action: Action.ViewUser, + + /** + * The member to view. May be null or falsy to indicate that no member + * should be shown (hide whichever relevant components). + */ + member?: RoomMember; +} From e4835c4b03f7f3bb1451f75a613a90a5d3b53ce9 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 13 May 2020 21:07:19 -0600 Subject: [PATCH 30/86] Demonstrate dis.fire() with view_user_settings Like a5f3318f3bec7d66c20a862669c3c1b938b362a6, this proves that the new dispatcher conversion works for fire-and-forget style dispatches too. This is another obvious-if-broken and generally safe conversion to make. Other actions which can be dispatched this way have been excluded for reasons mentioned in the Action enum's comments. --- .../views/dialogs/eventindex/DisableEventIndexDialog.js | 3 ++- .../views/dialogs/keybackup/NewRecoveryMethodDialog.js | 3 ++- .../dialogs/keybackup/RecoveryMethodRemovedDialog.js | 3 ++- src/components/structures/MatrixChat.tsx | 8 +++----- src/components/views/context_menus/TopLeftMenu.js | 3 ++- src/components/views/dialogs/AddressPickerDialog.js | 3 ++- .../views/dialogs/IntegrationsDisabledDialog.js | 3 ++- src/components/views/dialogs/InviteDialog.js | 3 ++- src/components/views/room_settings/UrlPreviewSettings.js | 3 ++- src/dispatcher/actions.ts | 5 +++++ 10 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/async-components/views/dialogs/eventindex/DisableEventIndexDialog.js b/src/async-components/views/dialogs/eventindex/DisableEventIndexDialog.js index 8af0bf278e..ec4b88f759 100644 --- a/src/async-components/views/dialogs/eventindex/DisableEventIndexDialog.js +++ b/src/async-components/views/dialogs/eventindex/DisableEventIndexDialog.js @@ -22,6 +22,7 @@ import { _t } from '../../../../languageHandler'; import SettingsStore, {SettingLevel} from "../../../../settings/SettingsStore"; import EventIndexPeg from "../../../../indexing/EventIndexPeg"; +import {Action} from "../../../../dispatcher/actions"; /* * Allows the user to disable the Event Index. @@ -47,7 +48,7 @@ export default class DisableEventIndexDialog extends React.Component { await SettingsStore.setValue('enableEventIndexing', null, SettingLevel.DEVICE, false); await EventIndexPeg.deleteEventIndex(); this.props.onFinished(); - dis.dispatch({ action: 'view_user_settings' }); + dis.fire(Action.ViewUserSettings); } render() { diff --git a/src/async-components/views/dialogs/keybackup/NewRecoveryMethodDialog.js b/src/async-components/views/dialogs/keybackup/NewRecoveryMethodDialog.js index f00f2d9c3c..74552a5c08 100644 --- a/src/async-components/views/dialogs/keybackup/NewRecoveryMethodDialog.js +++ b/src/async-components/views/dialogs/keybackup/NewRecoveryMethodDialog.js @@ -22,6 +22,7 @@ import {MatrixClientPeg} from '../../../../MatrixClientPeg'; import dis from "../../../../dispatcher/dispatcher"; import { _t } from "../../../../languageHandler"; import Modal from "../../../../Modal"; +import {Action} from "../../../../dispatcher/actions"; export default class NewRecoveryMethodDialog extends React.PureComponent { static propTypes = { @@ -36,7 +37,7 @@ export default class NewRecoveryMethodDialog extends React.PureComponent { onGoToSettingsClick = () => { this.props.onFinished(); - dis.dispatch({ action: 'view_user_settings' }); + dis.fire(Action.ViewUserSettings); } onSetupClick = async () => { diff --git a/src/async-components/views/dialogs/keybackup/RecoveryMethodRemovedDialog.js b/src/async-components/views/dialogs/keybackup/RecoveryMethodRemovedDialog.js index 722334cd70..cda353e717 100644 --- a/src/async-components/views/dialogs/keybackup/RecoveryMethodRemovedDialog.js +++ b/src/async-components/views/dialogs/keybackup/RecoveryMethodRemovedDialog.js @@ -21,6 +21,7 @@ import * as sdk from "../../../../index"; import dis from "../../../../dispatcher/dispatcher"; import { _t } from "../../../../languageHandler"; import Modal from "../../../../Modal"; +import {Action} from "../../../../dispatcher/actions"; export default class RecoveryMethodRemovedDialog extends React.PureComponent { static propTypes = { @@ -29,7 +30,7 @@ export default class RecoveryMethodRemovedDialog extends React.PureComponent { onGoToSettingsClick = () => { this.props.onFinished(); - dis.dispatch({ action: 'view_user_settings' }); + dis.fire(Action.ViewUserSettings); } onSetupClick = () => { diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index d368b2c23a..cf0388c490 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -107,7 +107,7 @@ export enum Views { // re-dispatched. NOTE: some actions are non-trivial and would require // re-factoring to be included in this list in future. const ONBOARDING_FLOW_STARTERS = [ - 'view_user_settings', + Action.ViewUserSettings, 'view_create_chat', 'view_create_room', 'view_create_group', @@ -613,7 +613,7 @@ export default class MatrixChat extends React.PureComponent { case 'view_indexed_room': this.viewIndexedRoom(payload.roomIndex); break; - case 'view_user_settings': { + case Action.ViewUserSettings: { const UserSettingsDialog = sdk.getComponent("dialogs.UserSettingsDialog"); Modal.createTrackedDialog('User settings', '', UserSettingsDialog, {}, /*className=*/null, /*isPriority=*/false, /*isStatic=*/true); @@ -1621,9 +1621,7 @@ export default class MatrixChat extends React.PureComponent { action: 'view_create_room', }); } else if (screen === 'settings') { - dis.dispatch({ - action: 'view_user_settings', - }); + dis.fire(Action.ViewUserSettings); } else if (screen === 'welcome') { dis.dispatch({ action: 'view_welcome_page', diff --git a/src/components/views/context_menus/TopLeftMenu.js b/src/components/views/context_menus/TopLeftMenu.js index 3ec857be2f..ec99c63724 100644 --- a/src/components/views/context_menus/TopLeftMenu.js +++ b/src/components/views/context_menus/TopLeftMenu.js @@ -27,6 +27,7 @@ import {MatrixClientPeg} from '../../../MatrixClientPeg'; import {MenuItem} from "../../structures/ContextMenu"; import * as sdk from "../../../index"; import {getHomePageUrl} from "../../../utils/pages"; +import {Action} from "../../../dispatcher/actions"; export default class TopLeftMenu extends React.Component { static propTypes = { @@ -134,7 +135,7 @@ export default class TopLeftMenu extends React.Component { } openSettings() { - dis.dispatch({action: 'view_user_settings'}); + dis.fire(Action.ViewUserSettings); this.closeMenu(); } diff --git a/src/components/views/dialogs/AddressPickerDialog.js b/src/components/views/dialogs/AddressPickerDialog.js index 41a819c005..8ddd89dc65 100644 --- a/src/components/views/dialogs/AddressPickerDialog.js +++ b/src/components/views/dialogs/AddressPickerDialog.js @@ -33,6 +33,7 @@ import { getDefaultIdentityServerUrl, useDefaultIdentityServer } from '../../../ import { abbreviateUrl } from '../../../utils/UrlUtils'; import {sleep} from "../../../utils/promise"; import {Key} from "../../../Keyboard"; +import {Action} from "../../../dispatcher/actions"; const TRUNCATE_QUERY_LIST = 40; const QUERY_USER_DIRECTORY_DEBOUNCE_MS = 200; @@ -615,7 +616,7 @@ export default createReactClass({ onManageSettingsClick(e) { e.preventDefault(); - dis.dispatch({ action: 'view_user_settings' }); + dis.fire(Action.ViewUserSettings); this.onCancel(); }, diff --git a/src/components/views/dialogs/IntegrationsDisabledDialog.js b/src/components/views/dialogs/IntegrationsDisabledDialog.js index 2677963281..7c996fbeab 100644 --- a/src/components/views/dialogs/IntegrationsDisabledDialog.js +++ b/src/components/views/dialogs/IntegrationsDisabledDialog.js @@ -19,6 +19,7 @@ import PropTypes from 'prop-types'; import {_t} from "../../../languageHandler"; import * as sdk from "../../../index"; import dis from '../../../dispatcher/dispatcher'; +import {Action} from "../../../dispatcher/actions"; export default class IntegrationsDisabledDialog extends React.Component { static propTypes = { @@ -31,7 +32,7 @@ export default class IntegrationsDisabledDialog extends React.Component { _onOpenSettingsClick = () => { this.props.onFinished(); - dis.dispatch({action: "view_user_settings"}); + dis.fire(Action.ViewUserSettings); }; render() { diff --git a/src/components/views/dialogs/InviteDialog.js b/src/components/views/dialogs/InviteDialog.js index e62c417a70..1e624f7545 100644 --- a/src/components/views/dialogs/InviteDialog.js +++ b/src/components/views/dialogs/InviteDialog.js @@ -36,6 +36,7 @@ import {inviteMultipleToRoom} from "../../../RoomInvite"; import SettingsStore from '../../../settings/SettingsStore'; import RoomListStore, {TAG_DM} from "../../../stores/RoomListStore"; import {Key} from "../../../Keyboard"; +import {Action} from "../../../dispatcher/actions"; export const KIND_DM = "dm"; export const KIND_INVITE = "invite"; @@ -902,7 +903,7 @@ export default class InviteDialog extends React.PureComponent { _onManageSettingsClick = (e) => { e.preventDefault(); - dis.dispatch({ action: 'view_user_settings' }); + dis.fire(Action.ViewUserSettings); this.props.onFinished(); }; diff --git a/src/components/views/room_settings/UrlPreviewSettings.js b/src/components/views/room_settings/UrlPreviewSettings.js index 16dffd857b..cd00e5048c 100644 --- a/src/components/views/room_settings/UrlPreviewSettings.js +++ b/src/components/views/room_settings/UrlPreviewSettings.js @@ -25,6 +25,7 @@ import { _t, _td } from '../../../languageHandler'; import SettingsStore, {SettingLevel} from "../../../settings/SettingsStore"; import dis from "../../../dispatcher/dispatcher"; import {MatrixClientPeg} from "../../../MatrixClientPeg"; +import {Action} from "../../../dispatcher/actions"; export default createReactClass({ @@ -37,7 +38,7 @@ export default createReactClass({ _onClickUserSettings: (e) => { e.preventDefault(); e.stopPropagation(); - dis.dispatch({action: 'view_user_settings'}); + dis.fire(Action.ViewUserSettings); }, render: function() { diff --git a/src/dispatcher/actions.ts b/src/dispatcher/actions.ts index 880e7e62cd..a2f9c3efe3 100644 --- a/src/dispatcher/actions.ts +++ b/src/dispatcher/actions.ts @@ -33,5 +33,10 @@ export enum Action { * View a user's profile. Should be used with a ViewUserPayload. */ ViewUser = "view_user", + + /** + * Open the user settings. No additional payload information required. + */ + ViewUserSettings = "view_user_settings", } From 62fee732429fde3e2656dd7e3943c3ada6736507 Mon Sep 17 00:00:00 2001 From: Jeff Huang Date: Thu, 14 May 2020 03:15:43 +0000 Subject: [PATCH 31/86] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (2312 of 2312 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/zh_Hant/ --- src/i18n/strings/zh_Hant.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/zh_Hant.json b/src/i18n/strings/zh_Hant.json index 257b245e1c..0ca6cfc586 100644 --- a/src/i18n/strings/zh_Hant.json +++ b/src/i18n/strings/zh_Hant.json @@ -2425,5 +2425,10 @@ "Opens chat with the given user": "開啟與指定使用者的聊天", "Sends a message to the given user": "傳送訊息給指定的使用者", "Waiting for your other session to verify…": "正在等待您的其他工作階段進行驗證……", - "You've successfully verified your device!": "您已成功驗證您的裝置!" + "You've successfully verified your device!": "您已成功驗證您的裝置!", + "To continue, use Single Sign On to prove your identity.": "要繼續,使用單一登入系統來證明您的身份。", + "Confirm to continue": "確認以繼續", + "Click the button below to confirm your identity.": "點擊下方按鈕以確認您的身份。", + "Confirm encryption setup": "確認加密設定", + "Click the button below to confirm setting up encryption.": "點擊下方按鈕以確認設定加密。" } From 5672ff577bb635574d086a4572599dbc8839ac02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Priit=20J=C3=B5er=C3=BC=C3=BCt?= Date: Thu, 14 May 2020 07:00:39 +0000 Subject: [PATCH 32/86] Translated using Weblate (Estonian) Currently translated at 46.7% (1080 of 2312 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/et/ --- src/i18n/strings/et.json | 45 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/et.json b/src/i18n/strings/et.json index cda3a5e76d..88301258a5 100644 --- a/src/i18n/strings/et.json +++ b/src/i18n/strings/et.json @@ -1039,5 +1039,48 @@ "Preview": "Eelvaade", "View": "Näita", "Message not sent due to unknown sessions being present": "Sõnum on saatmata, sest jutuoas on tundmatud sessioonid", - "You can't send any messages until you review and agree to our terms and conditions.": "Sa ei saa saata ühtego sõnumit enne, kui oled läbi lugenud ja nõustunud meie kasutustingimustega." + "You can't send any messages until you review and agree to our terms and conditions.": "Sa ei saa saata ühtego sõnumit enne, kui oled läbi lugenud ja nõustunud meie kasutustingimustega.", + "Couldn't load page": "Lehe laadimine ei õnnestunud", + "You must register to use this functionality": "Selle funktsionaalsuse kasutamiseks pead sa registreeruma", + "

HTML for your community's page

\n

\n Use the long description to introduce new members to the community, or distribute\n some important links\n

\n

\n You can even use 'img' tags\n

\n": "

Sinu kogukonna lehe HTML'i näidis - see on pealkiri

\n

\n Tutvustamaks uutele liikmetele kogukonda, kasuta seda pikka kirjeldust\n või jaga olulist teavet viidetena\n

\n

\n Pildite lisaminseks võid sa isegi kasutada img-märgendit\n

\n", + "Add to summary": "Lisa kokkuvõtte lehele", + "Add a Room": "Lisa jututuba", + "The room '%(roomName)s' could not be removed from the summary.": "Valitud %(roomName)s jututoa eemaldamine koondinfost ei õnnestunud.", + "Add users to the community summary": "Lisa kasutajad kogukonna kokkuvõtte lehele", + "Who would you like to add to this summary?": "Keda sa sooviksid lisada siia kokkuvõtte lehele?", + "Failed to add the following users to the summary of %(groupId)s:": "Järgnevate kasutajate lisamine %(groupId)s kogukonna koondinfo lehele ei õnnestunud:", + "Add a User": "Lisa kasutaja", + "The user '%(displayName)s' could not be removed from the summary.": "Kasutaja %(displayName)s eemaldamine koondinfo lehelt ei õnnestunud.", + "Failed to upload image": "Pildi üleslaadimine ei õnnestunud", + "Failed to update community": "Kogukonna uuendamine ei õnnestunud", + "Unable to accept invite": "Ei saanud kutset vastu võtta", + "Unable to join community": "Ei õnnetunud liituda kogukonnaga", + "You are an administrator of this community. You will not be able to rejoin without an invite from another administrator.": "Sa oled selle kogukonna haldur. Sa ei saa uuesti liituda ilma kutseta mõnelt teiselt administraatori õigustes liikmelt.", + "Leave Community": "Lahku kogukonnast", + "Leave %(groupName)s?": "Lahku %(groupName)s kogukonnast?", + "Unable to leave community": "Kogukonnast lahkumine ei õnnestunud", + "Community Settings": "Kogukonna seadistused", + "Want more than a community? Get your own server": "Soovid enamat kui kogukond? Pane üles oma server", + "Changes made to your community name and avatar might not be seen by other users for up to 30 minutes.": "Oma kogukonnas tehtud nime ja avatari muudatused ei pruugi teistele näha olla kuni 30 minuti jooksul.", + "Featured Users:": "Esiletõstetud kasutajad:", + "%(inviter)s has invited you to join this community": "%(inviter)s on kutsunud sind kogukonna liikmeks", + "Join this community": "Liitu selle kogukonnaga", + "Leave this community": "Lahku sellest kogukonnast", + "You are an administrator of this community": "Sa oled selle kogukonna haldur", + "You are a member of this community": "Sa oled kogukonna liige", + "Who can join this community?": "Kes võib liituda selle kogukonnaga?", + "Everyone": "Kes iganes soovib", + "Your community hasn't got a Long Description, a HTML page to show to community members.
Click here to open settings and give it one!": "Sinu kogukonnal on puudu pikk kirjeldus, mis pole muud kui lihtne HTML-leht, mida kuvatakse liikmetele.
Klõpsi siia ja loo selline leht!", + "Long Description (HTML)": "Pikk kirjeldus (HTML)", + "Upload avatar": "Lae üles profiilipilt ehk avatar", + "Description": "Kirjeldus", + "Community %(groupId)s not found": "%(groupId)s kogukonda ei leidunud", + "This homeserver does not support communities": "See koduserver ei toeta kogukondade funktsionaalsust", + "Failed to load %(groupId)s": "%(groupId)s kogukonna laadimine ei õnnestunud", + "Welcome to %(appName)s": "Tere tulemast %(appName)s kasutajaks", + "Liberate your communication": "Vabasta oma suhtlus", + "Send a Direct Message": "Saada otsesõnum", + "Are you sure you want to leave the room '%(roomName)s'?": "Kas oled kindel, et soovid lahkuda jututoast '%(roomName)s'?", + "Unknown error": "Teadmata viga", + "To continue using the %(homeserverDomain)s homeserver you must review and agree to our terms and conditions.": "Selleka et jätkata koduserveri %(homeserverDomain)s kasutamist sa pead üle vaatama ja nõustuma meie kasutamistingimustega." } From 1af2bdbc0ec7cddaa45edc131da66f24269d5724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20C?= Date: Thu, 14 May 2020 06:10:18 +0000 Subject: [PATCH 33/86] Translated using Weblate (French) Currently translated at 100.0% (2312 of 2312 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/fr/ --- src/i18n/strings/fr.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/fr.json b/src/i18n/strings/fr.json index 7546385bf6..3fac2168a2 100644 --- a/src/i18n/strings/fr.json +++ b/src/i18n/strings/fr.json @@ -2426,5 +2426,10 @@ "Opens chat with the given user": "Ouvre une discussion avec l’utilisateur fourni", "Sends a message to the given user": "Envoie un message à l’utilisateur fourni", "Waiting for your other session to verify…": "En attente de la vérification depuis votre autre session…", - "You've successfully verified your device!": "Vous avez bien vérifié votre appareil !" + "You've successfully verified your device!": "Vous avez bien vérifié votre appareil !", + "To continue, use Single Sign On to prove your identity.": "Pour continuer, utilisez l’authentification unique pour prouver votre identité.", + "Confirm to continue": "Confirmer pour continuer", + "Click the button below to confirm your identity.": "Cliquez sur le bouton ci-dessous pour confirmer votre identité.", + "Confirm encryption setup": "Confirmer la configuration du chiffrement", + "Click the button below to confirm setting up encryption.": "Cliquez sur le bouton ci-dessous pour confirmer la configuration du chiffrement." } From 9869ae4672c55679c8bee62f6505db5aeeec05ca Mon Sep 17 00:00:00 2001 From: Imre Kristoffer Eilertsen Date: Thu, 14 May 2020 07:32:33 +0000 Subject: [PATCH 34/86] =?UTF-8?q?Translated=20using=20Weblate=20(Norwegian?= =?UTF-8?q?=20Bokm=C3=A5l)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 57.6% (1332 of 2312 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/nb_NO/ --- src/i18n/strings/nb_NO.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/nb_NO.json b/src/i18n/strings/nb_NO.json index 147584ed00..59182a0249 100644 --- a/src/i18n/strings/nb_NO.json +++ b/src/i18n/strings/nb_NO.json @@ -1341,5 +1341,6 @@ "You're done!": "Du har gjort alt klart!", "Enter a recovery passphrase...": "Skriv inn en gjenopprettingspassfrase …", "Please enter your recovery passphrase a second time to confirm.": "Skriv inn gjenopprettingspassfrasen din en andre gang for å bekrefte.", - "Repeat your recovery passphrase...": "Gjenta gjenopprettingspassfrasen din …" + "Repeat your recovery passphrase...": "Gjenta gjenopprettingspassfrasen din …", + "Other users may not trust it": "Andre brukere kan kanskje mistro den" } From d1c6f3099c0fbcbb8e2d94f19660a99d8a378c2b Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 14 May 2020 11:20:06 +0100 Subject: [PATCH 35/86] move styling to QRCode scss Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- res/css/_components.scss | 1 + res/css/views/dialogs/_ShareDialog.scss | 6 ------ res/css/views/elements/_QRCode.scss | 21 +++++++++++++++++++++ 3 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 res/css/views/elements/_QRCode.scss diff --git a/res/css/_components.scss b/res/css/_components.scss index 428a28ac3a..c05e2cabc6 100644 --- a/res/css/_components.scss +++ b/res/css/_components.scss @@ -108,6 +108,7 @@ @import "./views/elements/_ManageIntegsButton.scss"; @import "./views/elements/_PowerSelector.scss"; @import "./views/elements/_ProgressBar.scss"; +@import "./views/elements/_QRCode.scss"; @import "./views/elements/_ReplyThread.scss"; @import "./views/elements/_ResizeHandle.scss"; @import "./views/elements/_RichText.scss"; diff --git a/res/css/views/dialogs/_ShareDialog.scss b/res/css/views/dialogs/_ShareDialog.scss index 3c984bbd1b..e08469ec6d 100644 --- a/res/css/views/dialogs/_ShareDialog.scss +++ b/res/css/views/dialogs/_ShareDialog.scss @@ -67,12 +67,6 @@ limitations under the License. height: 256px; width: 256px; margin-right: 64px; - - img { - width: 100%; - height: 100%; - border-radius: 8px; - } } .mx_ShareDialog_social_container { diff --git a/res/css/views/elements/_QRCode.scss b/res/css/views/elements/_QRCode.scss new file mode 100644 index 0000000000..96d9114b54 --- /dev/null +++ b/res/css/views/elements/_QRCode.scss @@ -0,0 +1,21 @@ +/* +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. +*/ + +.mx_QRCode { + img { + border-radius: 8px; + } +} From 4c7d7032755f7a3e144efe696e5e60279b876fdf Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 14 May 2020 11:20:27 +0100 Subject: [PATCH 36/86] Reuse QRCode for VerificationQRCode and specify widths Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/dialogs/ShareDialog.tsx | 2 +- src/components/views/elements/QRCode.tsx | 9 ++--- .../elements/crypto/VerificationQRCode.js | 36 ++++--------------- 3 files changed, 13 insertions(+), 34 deletions(-) diff --git a/src/components/views/dialogs/ShareDialog.tsx b/src/components/views/dialogs/ShareDialog.tsx index 3924fd42ec..271f754fd2 100644 --- a/src/components/views/dialogs/ShareDialog.tsx +++ b/src/components/views/dialogs/ShareDialog.tsx @@ -221,7 +221,7 @@ export default class ShareDialog extends React.PureComponent {
- +
{ socials.map((social) => ( diff --git a/src/components/views/elements/QRCode.tsx b/src/components/views/elements/QRCode.tsx index 9c867058c0..f70ab48fa3 100644 --- a/src/components/views/elements/QRCode.tsx +++ b/src/components/views/elements/QRCode.tsx @@ -16,19 +16,21 @@ limitations under the License. import * as React from "react"; import {toDataURL, QRCodeSegment, QRCodeToDataURLOptions} from "qrcode"; +import classNames from "classnames"; import {_t} from "../../../languageHandler"; import Spinner from "./Spinner"; interface IProps extends QRCodeToDataURLOptions { data: string | QRCodeSegment[]; + className?: string; } const defaultOptions: QRCodeToDataURLOptions = { errorCorrectionLevel: 'L', // we want it as trivial-looking as possible }; -const QRCode: React.FC = ({data, ...options}) => { +const QRCode: React.FC = ({data, className, ...options}) => { const [dataUri, setUri] = React.useState(null); React.useEffect(() => { let cancelled = false; @@ -39,10 +41,9 @@ const QRCode: React.FC = ({data, ...options}) => { return () => { cancelled = true; }; - }, [data, options]); + }, [JSON.stringify(data), options]); - - return
+ return
{ dataUri ? {_t("QR : }
; }; diff --git a/src/components/views/elements/crypto/VerificationQRCode.js b/src/components/views/elements/crypto/VerificationQRCode.js index 08cd0c772e..3bbfb004c6 100644 --- a/src/components/views/elements/crypto/VerificationQRCode.js +++ b/src/components/views/elements/crypto/VerificationQRCode.js @@ -17,8 +17,7 @@ limitations under the License. import React from "react"; import PropTypes from "prop-types"; import {replaceableComponent} from "../../../../utils/replaceableComponent"; -import Spinner from "../Spinner"; -import * as QRCode from "qrcode"; +import QRCode from "../QRCode"; @replaceableComponent("views.elements.crypto.VerificationQRCode") export default class VerificationQRCode extends React.PureComponent { @@ -26,33 +25,12 @@ export default class VerificationQRCode extends React.PureComponent { qrCodeData: PropTypes.object.isRequired, }; - constructor(props) { - super(props); - this.state = { - dataUri: null, - }; - this.generateQrCode(); - } - - componentDidUpdate(prevProps): void { - if (JSON.stringify(this.props) === JSON.stringify(prevProps)) return; // No prop change - - this.generateQRCode(); - } - - async generateQrCode() { - // Now actually assemble the QR code's data URI - const uri = await QRCode.toDataURL([{data: this.props.qrCodeData.buffer, mode: 'byte'}], { - errorCorrectionLevel: 'L', // we want it as trivial-looking as possible - }); - this.setState({dataUri: uri}); - } - render() { - if (!this.state.dataUri) { - return
; - } - - return ; + return ( + + ); } } From edba204408483ad41db5abaeb04768e945a233a5 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 14 May 2020 13:04:30 +0100 Subject: [PATCH 37/86] accept and linkify local domains like those from mDNS Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/linkify-matrix.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/linkify-matrix.js b/src/linkify-matrix.js index ee9f703136..77c62ce84d 100644 --- a/src/linkify-matrix.js +++ b/src/linkify-matrix.js @@ -44,7 +44,7 @@ function matrixLinkify(linkify) { const S_HASH = S_START.jump(TT.POUND); const S_HASH_NAME = new linkify.parser.State(); const S_HASH_NAME_COLON = new linkify.parser.State(); - const S_HASH_NAME_COLON_DOMAIN = new linkify.parser.State(); + const S_HASH_NAME_COLON_DOMAIN = new linkify.parser.State(ROOMALIAS); const S_HASH_NAME_COLON_DOMAIN_DOT = new linkify.parser.State(); const S_ROOMALIAS = new linkify.parser.State(ROOMALIAS); const S_ROOMALIAS_COLON = new linkify.parser.State(); @@ -92,7 +92,7 @@ function matrixLinkify(linkify) { const S_AT = S_START.jump(TT.AT); const S_AT_NAME = new linkify.parser.State(); const S_AT_NAME_COLON = new linkify.parser.State(); - const S_AT_NAME_COLON_DOMAIN = new linkify.parser.State(); + const S_AT_NAME_COLON_DOMAIN = new linkify.parser.State(USERID); const S_AT_NAME_COLON_DOMAIN_DOT = new linkify.parser.State(); const S_USERID = new linkify.parser.State(USERID); const S_USERID_COLON = new linkify.parser.State(); @@ -138,7 +138,7 @@ function matrixLinkify(linkify) { const S_PLUS = S_START.jump(TT.PLUS); const S_PLUS_NAME = new linkify.parser.State(); const S_PLUS_NAME_COLON = new linkify.parser.State(); - const S_PLUS_NAME_COLON_DOMAIN = new linkify.parser.State(); + const S_PLUS_NAME_COLON_DOMAIN = new linkify.parser.State(GROUPID); const S_PLUS_NAME_COLON_DOMAIN_DOT = new linkify.parser.State(); const S_GROUPID = new linkify.parser.State(GROUPID); const S_GROUPID_COLON = new linkify.parser.State(); From 822b4b4fff2260a3be35c8afc0f54065f8d15298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanislav=20Luke=C5=A1?= Date: Thu, 14 May 2020 10:50:35 +0000 Subject: [PATCH 38/86] Translated using Weblate (Czech) Currently translated at 95.2% (2198 of 2308 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/cs/ --- src/i18n/strings/cs.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/cs.json b/src/i18n/strings/cs.json index 181a692b73..ddd5e5521b 100644 --- a/src/i18n/strings/cs.json +++ b/src/i18n/strings/cs.json @@ -2293,5 +2293,6 @@ "Opens chat with the given user": "Otevře konverzaci s tímto uživatelem", "Sends a message to the given user": "Pošle zprávu danému uživateli", "Waiting for your other session to verify…": "Čekáme na ověření od vaší druhé relace…", - "Verify all your sessions to ensure your account & messages are safe": "Ověřte všechny své relace, abyste zaručili, že jsou vaše zprávy a účet bezpečné" + "Verify all your sessions to ensure your account & messages are safe": "Ověřte všechny své relace, abyste zaručili, že jsou vaše zprávy a účet bezpečné", + "Verify the new login accessing your account: %(name)s": "Ověřte nové přihlášení na váš účet: %(name)s" } From 72e5e2e4b9f61be669532b38f56b169ccfbd8866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Priit=20J=C3=B5er=C3=BC=C3=BCt?= Date: Thu, 14 May 2020 08:22:14 +0000 Subject: [PATCH 39/86] Translated using Weblate (Estonian) Currently translated at 46.8% (1079 of 2308 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/et/ --- src/i18n/strings/et.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/strings/et.json b/src/i18n/strings/et.json index 88301258a5..948055c35a 100644 --- a/src/i18n/strings/et.json +++ b/src/i18n/strings/et.json @@ -6,7 +6,7 @@ "Failed to verify email address: make sure you clicked the link in the email": "E-posti aadressi kontrollimine ei õnnestunud: palun vaata, et sa kindlasti klõpsisid saabunud kirjas olnud viidet", "The platform you're on": "Sinu kasutatav arvutisüsteem", "The version of Riot": "Riot'i versioon", - "Whether or not you're logged in (we don't record your username)": "Kas sa oled sisseloginud või mitte (me ei salvesta sinu kasutajanime)", + "Whether or not you're logged in (we don't record your username)": "Kas sa oled sisseloginud või mitte (me ei salvesta sinu kasutajanime)", "Your language of choice": "Sinu keelevalik", "Your homeserver's URL": "Sinu koduserveri aadress", "e.g. ": "näiteks ", From 91134601f6317fee286bfd94b560614de5b6e4d1 Mon Sep 17 00:00:00 2001 From: random Date: Thu, 14 May 2020 10:23:04 +0000 Subject: [PATCH 40/86] Translated using Weblate (Italian) Currently translated at 100.0% (2308 of 2308 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/it/ --- src/i18n/strings/it.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/it.json b/src/i18n/strings/it.json index d891a06687..e79db1b061 100644 --- a/src/i18n/strings/it.json +++ b/src/i18n/strings/it.json @@ -2417,5 +2417,14 @@ "Verify your other session using one of the options below.": "Verifica la tua altra sessione usando una delle opzioni sotto.", "Invite someone using their name, username (like ), email address or share this room.": "Invita qualcuno usando il suo nome, nome utente (come ), indirizzo email o condividi questa stanza.", "Message deleted": "Messaggio eliminato", - "Message deleted by %(name)s": "Messaggio eliminato da %(name)s" + "Message deleted by %(name)s": "Messaggio eliminato da %(name)s", + "Opens chat with the given user": "Apre una chat con l'utente specificato", + "Sends a message to the given user": "Invia un messaggio all'utente specificato", + "Waiting for your other session to verify…": "In attesa che la tua altra sessione verifichi…", + "You've successfully verified your device!": "Hai verificato correttamente il tuo dispositivo!", + "To continue, use Single Sign On to prove your identity.": "Per continuare, usa Single Sign On per provare la tua identità.", + "Confirm to continue": "Conferma per continuare", + "Click the button below to confirm your identity.": "Clicca il pulsante sotto per confermare la tua identità.", + "Confirm encryption setup": "Conferma impostazione cifratura", + "Click the button below to confirm setting up encryption.": "Clicca il pulsante sotto per confermare l'impostazione della cifratura." } From e241da3af0d153d6b20b8de2d85c66f306419ffa Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 14 May 2020 15:35:38 +0100 Subject: [PATCH 41/86] Fix diff wrong route offsets because of skipping a node insert Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/utils/MessageDiffUtils.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/utils/MessageDiffUtils.js b/src/utils/MessageDiffUtils.js index de0d8fdc89..7398173fdd 100644 --- a/src/utils/MessageDiffUtils.js +++ b/src/utils/MessageDiffUtils.js @@ -77,8 +77,6 @@ function findRefNodes(root, route, isAddition) { const end = isAddition ? route.length - 1 : route.length; for (let i = 0; i < end; ++i) { refParentNode = refNode; - // Lists don't have appropriate child nodes we can use. - if (!refNode.childNodes[route[i]]) continue; refNode = refNode.childNodes[route[i]]; } return {refNode, refParentNode}; @@ -190,10 +188,11 @@ function renderDifferenceInDOM(originalRootNode, diff, diffMathPatch) { break; } case "addTextElement": { - if (diff.value !== "\n") { - const insNode = wrapInsertion(stringAsTextNode(diff.value)); - insertBefore(refParentNode, refNode, insNode); - } + // XXX: sometimes diffDOM says insert a newline when there shouldn't be one + // but we must insert the node anyway so that we don't break the route child IDs. + // See https://github.com/fiduswriter/diffDOM/issues/100 + const insNode = wrapInsertion(stringAsTextNode(diff.value !== "\n" ? diff.value : "")); + insertBefore(refParentNode, refNode, insNode); break; } // e.g. when changing a the href of a link, From d8003df24c660d0ed895f99c21eda24abaf4d13e Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Thu, 14 May 2020 16:22:30 +0100 Subject: [PATCH 42/86] Upgrade matrix-js-sdk to 6.1.0-rc.1 --- package.json | 2 +- yarn.lock | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 92d228a812..e77b7b26b8 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "is-ip": "^2.0.0", "linkifyjs": "^2.1.6", "lodash": "^4.17.14", - "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop", + "matrix-js-sdk": "6.1.0-rc.1", "minimist": "^1.2.0", "pako": "^1.0.5", "parse5": "^5.1.1", diff --git a/yarn.lock b/yarn.lock index 520e976b17..d05c444470 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5720,9 +5720,10 @@ mathml-tag-names@^2.0.1: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== -"matrix-js-sdk@github:matrix-org/matrix-js-sdk#develop": - version "6.0.0" - resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/f120533fadb309ac5dc8b2bcb6882e784ba93f18" +matrix-js-sdk@6.1.0-rc.1: + version "6.1.0-rc.1" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-6.1.0-rc.1.tgz#521d5683d10e49bb437b2457d1f0c6696fc7a4e3" + integrity sha512-q3XScyroUwY3qTBglRgE1lldfrLlSML5nU4gJzXrEwn2gGpR1P4IU8aT8EcumyOmeZhrrysS2UEE9fWgUmhkBw== dependencies: "@babel/runtime" "^7.8.3" another-json "^0.2.0" From 4a7487aa20d0abffb7b242a399e1bd4f39a33a28 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Thu, 14 May 2020 16:30:17 +0100 Subject: [PATCH 43/86] Prepare changelog for v2.6.0-rc.1 --- CHANGELOG.md | 262 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 262 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0706e20085..c34bfba87b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,265 @@ +Changes in [2.6.0-rc.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v2.6.0-rc.1) (2020-05-14) +============================================================================================================= +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v2.5.0...v2.6.0-rc.1) + + * Upgrade to JS SDK 6.1.0-rc.1 + * Update from Weblate + [\#4596](https://github.com/matrix-org/matrix-react-sdk/pull/4596) + * Fix message edits dialog being wrong and sometimes crashing + [\#4595](https://github.com/matrix-org/matrix-react-sdk/pull/4595) + * Acquire a new session before enacting deactivation + [\#4584](https://github.com/matrix-org/matrix-react-sdk/pull/4584) + * Remove UI for upgrading 4S to symmetric encryption + [\#4581](https://github.com/matrix-org/matrix-react-sdk/pull/4581) + * Add copy to SSO prompts during cross-signing setup + [\#4555](https://github.com/matrix-org/matrix-react-sdk/pull/4555) + * Re-fix OpenID requests from widgets + [\#4592](https://github.com/matrix-org/matrix-react-sdk/pull/4592) + * Fix persistent widgets on desktop / http + [\#4591](https://github.com/matrix-org/matrix-react-sdk/pull/4591) + * Updated link and added:Yarn two is not yet used. + [\#4589](https://github.com/matrix-org/matrix-react-sdk/pull/4589) + * Fix topic dialog not supporting escape as it didn't have a "Close" + [\#4578](https://github.com/matrix-org/matrix-react-sdk/pull/4578) + * Default to public room when creating room from room directory + [\#4579](https://github.com/matrix-org/matrix-react-sdk/pull/4579) + * Replace png flags and add Kosovo to country code dropdown + [\#4576](https://github.com/matrix-org/matrix-react-sdk/pull/4576) + * Rename `trash (custom).svg` as electron doesn't like paths with spaces + [\#4583](https://github.com/matrix-org/matrix-react-sdk/pull/4583) + * Fix sign in / up links on previewed rooms + [\#4582](https://github.com/matrix-org/matrix-react-sdk/pull/4582) + * Avoid soft crash if unknown device in verification + [\#4580](https://github.com/matrix-org/matrix-react-sdk/pull/4580) + * Add slash commands /query and /msg to match IRC + [\#4568](https://github.com/matrix-org/matrix-react-sdk/pull/4568) + * Send cross-signing debug booleans over rageshake + [\#4570](https://github.com/matrix-org/matrix-react-sdk/pull/4570) + * Prompt user to specify an alternate server if theirs has registration off + [\#4575](https://github.com/matrix-org/matrix-react-sdk/pull/4575) + * Don't try and redact redactions for "Remove recent messages" + [\#4573](https://github.com/matrix-org/matrix-react-sdk/pull/4573) + * View Source should target the replacing event rather than the root one + [\#4571](https://github.com/matrix-org/matrix-react-sdk/pull/4571) + * Fix passphrase reset in key backup restore dialog + [\#4569](https://github.com/matrix-org/matrix-react-sdk/pull/4569) + * Ensure key backup gets dealt with correctly during secret storage reset + [\#4556](https://github.com/matrix-org/matrix-react-sdk/pull/4556) + * Fix crash for broken invites + [\#4565](https://github.com/matrix-org/matrix-react-sdk/pull/4565) + * Fix rageshake with no matrix client + [\#4572](https://github.com/matrix-org/matrix-react-sdk/pull/4572) + * Update from Weblate + [\#4567](https://github.com/matrix-org/matrix-react-sdk/pull/4567) + * Bring back UnknownBody for UISIs + [\#4564](https://github.com/matrix-org/matrix-react-sdk/pull/4564) + * clear tag panel selection if the community selected is left + [\#4559](https://github.com/matrix-org/matrix-react-sdk/pull/4559) + * Close ImageView when redacting + [\#4560](https://github.com/matrix-org/matrix-react-sdk/pull/4560) + * Redesign redactions + [\#4484](https://github.com/matrix-org/matrix-react-sdk/pull/4484) + * Don't try to reload profile information when closing the user panel + [\#4547](https://github.com/matrix-org/matrix-react-sdk/pull/4547) + * Fix right panel hiding when viewing room member + [\#4558](https://github.com/matrix-org/matrix-react-sdk/pull/4558) + * Don't erase password confirm on registration error + [\#4540](https://github.com/matrix-org/matrix-react-sdk/pull/4540) + * Add a loading state for email addresses/phone numbers in settings + [\#4557](https://github.com/matrix-org/matrix-react-sdk/pull/4557) + * set the meta tag for theme-color to the same theme css background + [\#4554](https://github.com/matrix-org/matrix-react-sdk/pull/4554) + * Update Invite Dialog copy to include email addresses + [\#4497](https://github.com/matrix-org/matrix-react-sdk/pull/4497) + * Fix slider toggle regression. + [\#4546](https://github.com/matrix-org/matrix-react-sdk/pull/4546) + * Fix a crash where a name could unexpectedly be an empty list + [\#4552](https://github.com/matrix-org/matrix-react-sdk/pull/4552) + * Solves communities can be dragged from context menu + [\#4492](https://github.com/matrix-org/matrix-react-sdk/pull/4492) + * Remove prefixes for composer avatar urls + [\#4553](https://github.com/matrix-org/matrix-react-sdk/pull/4553) + * Fix reply RR spacing getting doubled + [\#4541](https://github.com/matrix-org/matrix-react-sdk/pull/4541) + * Differentiate copy for own untrusted device dialog + [\#4549](https://github.com/matrix-org/matrix-react-sdk/pull/4549) + * EventIndex: Reduce the logging the event index is producing. + [\#4548](https://github.com/matrix-org/matrix-react-sdk/pull/4548) + * Increase rageshake size limit to 5mb + [\#4543](https://github.com/matrix-org/matrix-react-sdk/pull/4543) + * Update from Weblate + [\#4542](https://github.com/matrix-org/matrix-react-sdk/pull/4542) + * Guard against race when waiting for cross-signing to be ready + [\#4539](https://github.com/matrix-org/matrix-react-sdk/pull/4539) + * Wait for user to be verified in e2e setup + [\#4537](https://github.com/matrix-org/matrix-react-sdk/pull/4537) + * Convert MatrixChat to a TypeScript class + [\#4462](https://github.com/matrix-org/matrix-react-sdk/pull/4462) + * Mark room as read when escape is pressed + [\#4271](https://github.com/matrix-org/matrix-react-sdk/pull/4271) + * Only show key backup reminder when confirmed by server to be missing + [\#4534](https://github.com/matrix-org/matrix-react-sdk/pull/4534) + * Add device name to unverified session toast + [\#4535](https://github.com/matrix-org/matrix-react-sdk/pull/4535) + * Show progress when loading keys + [\#4507](https://github.com/matrix-org/matrix-react-sdk/pull/4507) + * Fix device verification toasts not disappearing + [\#4532](https://github.com/matrix-org/matrix-react-sdk/pull/4532) + * Update toast copy again + [\#4529](https://github.com/matrix-org/matrix-react-sdk/pull/4529) + * Re-apply theme after login + [\#4518](https://github.com/matrix-org/matrix-react-sdk/pull/4518) + * Reduce maximum width of toasts & allow multiple lines + [\#4525](https://github.com/matrix-org/matrix-react-sdk/pull/4525) + * Treat sessions that are there when we log in as old + [\#4524](https://github.com/matrix-org/matrix-react-sdk/pull/4524) + * Allow resetting storage from the access dialog + [\#4521](https://github.com/matrix-org/matrix-react-sdk/pull/4521) + * Update (bulk) unverified device toast copy + [\#4522](https://github.com/matrix-org/matrix-react-sdk/pull/4522) + * Make new device toasts appear above review toasts + [\#4519](https://github.com/matrix-org/matrix-react-sdk/pull/4519) + * Separate toasts for existing & new device verification + [\#4511](https://github.com/matrix-org/matrix-react-sdk/pull/4511) + * Slightly darker toggle off bg color + [\#4477](https://github.com/matrix-org/matrix-react-sdk/pull/4477) + * Fix pill vertical align + [\#4514](https://github.com/matrix-org/matrix-react-sdk/pull/4514) + * Fix set up encryption toast to use "set up" as action + [\#4502](https://github.com/matrix-org/matrix-react-sdk/pull/4502) + * Don't enable e2ee when inviting a 3pid + [\#4509](https://github.com/matrix-org/matrix-react-sdk/pull/4509) + * Fix internal link styling in Security Settings + [\#4510](https://github.com/matrix-org/matrix-react-sdk/pull/4510) + * Small custom theming fixes + [\#4508](https://github.com/matrix-org/matrix-react-sdk/pull/4508) + * Fix scaling issues + [\#4355](https://github.com/matrix-org/matrix-react-sdk/pull/4355) + * Aggregate device verify toasts + [\#4506](https://github.com/matrix-org/matrix-react-sdk/pull/4506) + * Support setting username and avatar colors in custom themes + [\#4503](https://github.com/matrix-org/matrix-react-sdk/pull/4503) + * only clear on continuations where the clear isn't done by SenderProfile + [\#4501](https://github.com/matrix-org/matrix-react-sdk/pull/4501) + * cap width of editable item list item to leave space for its X button + [\#4495](https://github.com/matrix-org/matrix-react-sdk/pull/4495) + * Add a link from settings / devices to your user profile + [\#4498](https://github.com/matrix-org/matrix-react-sdk/pull/4498) + * Update from Weblate + [\#4496](https://github.com/matrix-org/matrix-react-sdk/pull/4496) + * Make icon change in SetupEncryptionDialog + [\#4485](https://github.com/matrix-org/matrix-react-sdk/pull/4485) + * Remove invite only padlocks feature flag + [\#4487](https://github.com/matrix-org/matrix-react-sdk/pull/4487) + * Fix incorrect toast if security setup skipped + [\#4486](https://github.com/matrix-org/matrix-react-sdk/pull/4486) + * Revert "Update emojibase for fixed emoji codepoints and Emoji 13 support" + [\#4482](https://github.com/matrix-org/matrix-react-sdk/pull/4482) + * Fix widget URL templating (again) + [\#4481](https://github.com/matrix-org/matrix-react-sdk/pull/4481) + * Fix recovery link on login verification flow + [\#4479](https://github.com/matrix-org/matrix-react-sdk/pull/4479) + * Make avatars in pills occupy the entire space using cropping + [\#4476](https://github.com/matrix-org/matrix-react-sdk/pull/4476) + * Use WidgetType more often to avoid breaking new sticker pickers + [\#4458](https://github.com/matrix-org/matrix-react-sdk/pull/4458) + * Update logging for unmanaged widgets, and add TODO comments for other areas + [\#4460](https://github.com/matrix-org/matrix-react-sdk/pull/4460) + * Fix OpenID requests from widgets + [\#4459](https://github.com/matrix-org/matrix-react-sdk/pull/4459) + * Take encrypted message search out of labs + [\#4467](https://github.com/matrix-org/matrix-react-sdk/pull/4467) + * Fix BigEmoji for replies + [\#4475](https://github.com/matrix-org/matrix-react-sdk/pull/4475) + * Update login security copy and design to match Figma + [\#4472](https://github.com/matrix-org/matrix-react-sdk/pull/4472) + * Fix i18n of SSO UIA copy in Deactivate Account Dialog + [\#4471](https://github.com/matrix-org/matrix-react-sdk/pull/4471) + * Assert type of domNode as HTMLElement to fix build + [\#4470](https://github.com/matrix-org/matrix-react-sdk/pull/4470) + * Unignored in settings + [\#4466](https://github.com/matrix-org/matrix-react-sdk/pull/4466) + * Skip auth flow test for signing upload when password present + [\#4464](https://github.com/matrix-org/matrix-react-sdk/pull/4464) + * If user cannot set email during registration don't tell them to + [\#4461](https://github.com/matrix-org/matrix-react-sdk/pull/4461) + * Fix post-ts autocomplete, it is not null + [\#4463](https://github.com/matrix-org/matrix-react-sdk/pull/4463) + * Convert autocomplete stuff to TypeScript + [\#4452](https://github.com/matrix-org/matrix-react-sdk/pull/4452) + * Add a back button to the devtools verifications panel + [\#4455](https://github.com/matrix-org/matrix-react-sdk/pull/4455) + * Fix: wait until cross-signing keys are fetched to show verify button + [\#4456](https://github.com/matrix-org/matrix-react-sdk/pull/4456) + * Handle load error in create secret storage dialog + [\#4451](https://github.com/matrix-org/matrix-react-sdk/pull/4451) + * Allow iframes and Jitsi URLs in /addwidget + [\#4382](https://github.com/matrix-org/matrix-react-sdk/pull/4382) + * Support m.jitsi-typed widgets as Jitsi widgets + [\#4379](https://github.com/matrix-org/matrix-react-sdk/pull/4379) + * Don't recheck DeviceListener until after initial sync is finished + [\#4450](https://github.com/matrix-org/matrix-react-sdk/pull/4450) + * Fix CSS class in ButtonPlaceholder + [\#4449](https://github.com/matrix-org/matrix-react-sdk/pull/4449) + * Password Login make sure tab takes user to password field + [\#4441](https://github.com/matrix-org/matrix-react-sdk/pull/4441) + * Network Dropdown fix things not scrolling properly + [\#4439](https://github.com/matrix-org/matrix-react-sdk/pull/4439) + * ImageView make clicking off it easier + [\#4448](https://github.com/matrix-org/matrix-react-sdk/pull/4448) + * Add slash command to send a rageshake + [\#4443](https://github.com/matrix-org/matrix-react-sdk/pull/4443) + * EventIndex: Filter out events that don't have a propper content value. + [\#4446](https://github.com/matrix-org/matrix-react-sdk/pull/4446) + * Revert "Fix Filepanel scroll position state lost when room is changed" + [\#4445](https://github.com/matrix-org/matrix-react-sdk/pull/4445) + * Update seshat copy to remove trailing full stop + [\#4442](https://github.com/matrix-org/matrix-react-sdk/pull/4442) + * Fix Filepanel scroll position state lost when room is changed + [\#4388](https://github.com/matrix-org/matrix-react-sdk/pull/4388) + * Fix end-to-end tests for end-to-end encryption verification + [\#4436](https://github.com/matrix-org/matrix-react-sdk/pull/4436) + * Don't explode if the e2e test directory exists when crashing + [\#4437](https://github.com/matrix-org/matrix-react-sdk/pull/4437) + * Bump https-proxy-agent from 2.2.1 to 2.2.4 in /test/end-to-end-tests + [\#4430](https://github.com/matrix-org/matrix-react-sdk/pull/4430) + * Minor updates to e2e test instructions on Windows + [\#4432](https://github.com/matrix-org/matrix-react-sdk/pull/4432) + * Fix typo + [\#4435](https://github.com/matrix-org/matrix-react-sdk/pull/4435) + * Catch errors sooner so users can recover more easily + [\#4122](https://github.com/matrix-org/matrix-react-sdk/pull/4122) + * Rageshake: remind user of unsupported browser and send modernizr report + [\#4381](https://github.com/matrix-org/matrix-react-sdk/pull/4381) + * Design tweaks for DM Room Tiles + [\#4338](https://github.com/matrix-org/matrix-react-sdk/pull/4338) + * Don't break spills over multiple lines, ellipsis them at max-1-line + [\#4434](https://github.com/matrix-org/matrix-react-sdk/pull/4434) + * Turn the end-to-end tests back on and fix the lazy-loading tests + [\#4433](https://github.com/matrix-org/matrix-react-sdk/pull/4433) + * Fix key backup debug panel + [\#4431](https://github.com/matrix-org/matrix-react-sdk/pull/4431) + * Convert cross-signing feature flag to setting + [\#4416](https://github.com/matrix-org/matrix-react-sdk/pull/4416) + * Make RoomPublishSetting import-skinnable + [\#4428](https://github.com/matrix-org/matrix-react-sdk/pull/4428) + * Iterate cross-signing copy + [\#4425](https://github.com/matrix-org/matrix-react-sdk/pull/4425) + * Fix: ensure twemoji font is loaded when showing SAS emojis + [\#4422](https://github.com/matrix-org/matrix-react-sdk/pull/4422) + * Revert "Fix: load Twemoji before login so complete security gets the right + emojis during SAS" + [\#4421](https://github.com/matrix-org/matrix-react-sdk/pull/4421) + * Fix: load Twemoji before login so complete security gets the right emojis + during SAS + [\#4419](https://github.com/matrix-org/matrix-react-sdk/pull/4419) + * consolidate and fix copy to clipboard + [\#4410](https://github.com/matrix-org/matrix-react-sdk/pull/4410) + * Fix Message Context Menu options not displaying: block + [\#4418](https://github.com/matrix-org/matrix-react-sdk/pull/4418) + * Fix pills being broken by unescaped characters + [\#4411](https://github.com/matrix-org/matrix-react-sdk/pull/4411) + Changes in [2.5.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v2.5.0) (2020-05-05) =================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v2.5.0-rc.6...v2.5.0) From 81174b5f55a04971d02c6dbf09457ec59aeee61d Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Thu, 14 May 2020 16:30:17 +0100 Subject: [PATCH 44/86] v2.6.0-rc.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e77b7b26b8..8338a91bf7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "2.5.0", + "version": "2.6.0-rc.1", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { From cae28b48d6ed5de74e676e2a216637f5e73619d7 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 14 May 2020 09:43:34 -0600 Subject: [PATCH 45/86] Remove debugging that causes email addresses to load forever This was left in by accident for https://github.com/matrix-org/matrix-react-sdk/pull/4557 --- .../views/settings/tabs/user/GeneralUserSettingsTab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js index 867982ad2b..0f82ce3a32 100644 --- a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js +++ b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js @@ -348,7 +348,7 @@ export default class GeneralUserSettingsTab extends React.Component { // For newer homeservers with separate 3PID add and bind methods (MSC2290), // there is no such concern, so we can always show the HS account 3PIDs. if (this.state.haveIdServer || this.state.serverSupportsSeparateAddAndBind === true) { - const emails = this.state.loading3pids || true + const emails = this.state.loading3pids ? : Date: Thu, 14 May 2020 09:43:34 -0600 Subject: [PATCH 46/86] Remove debugging that causes email addresses to load forever This was left in by accident for https://github.com/matrix-org/matrix-react-sdk/pull/4557 --- .../views/settings/tabs/user/GeneralUserSettingsTab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js index 867982ad2b..0f82ce3a32 100644 --- a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js +++ b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.js @@ -348,7 +348,7 @@ export default class GeneralUserSettingsTab extends React.Component { // For newer homeservers with separate 3PID add and bind methods (MSC2290), // there is no such concern, so we can always show the HS account 3PIDs. if (this.state.haveIdServer || this.state.serverSupportsSeparateAddAndBind === true) { - const emails = this.state.loading3pids || true + const emails = this.state.loading3pids ? : Date: Thu, 14 May 2020 15:57:39 +0000 Subject: [PATCH 47/86] Translated using Weblate (Esperanto) Currently translated at 100.0% (2308 of 2308 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/eo/ --- src/i18n/strings/eo.json | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/i18n/strings/eo.json b/src/i18n/strings/eo.json index 9e8641a6e9..11239303f8 100644 --- a/src/i18n/strings/eo.json +++ b/src/i18n/strings/eo.json @@ -172,7 +172,7 @@ "New passwords don't match": "Novaj pasvortoj ne akordas", "Passwords can't be empty": "Pasvortoj ne povas esti malplenaj", "Continue": "Daŭrigi", - "Export E2E room keys": "Elporti ĝiscele ĉifrajn ŝlosilojn de la ĉambro", + "Export E2E room keys": "Elporti tutvoje ĉifrajn ŝlosilojn de la ĉambro", "Do you want to set an email address?": "Ĉu vi volas agordi retpoŝtadreson?", "Current password": "Nuna pasvorto", "Password": "Pasvorto", @@ -538,8 +538,8 @@ "Are you sure you want to leave the room '%(roomName)s'?": "Ĉu vi certe volas forlasi la ĉambron '%(roomName)s'?", "Failed to leave room": "Malsukcesis forlasi la ĉambron", "Signed Out": "Adiaŭinta", - "Old cryptography data detected": "Malnovaj kriptografiaj datumoj troviĝis", - "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.": "Datumoj el malnova versio de Riot troviĝis. Ĉi tio malfunkciigos ĝiscelan ĉifradon en la malnova versio. Ĝiscele ĉifritaj mesaĝoj interŝanĝitaj freŝtempe per la malnova versio eble ne malĉifreblos. Tio povas kaŭzi malsukceson ankaŭ al mesaĝoj interŝanĝitaj kun tiu ĉi versio. Se vin trafos problemoj, adiaŭu kaj resalutu. Por reteni mesaĝan historion, elportu kaj reenportu viajn ŝlosilojn.", + "Old cryptography data detected": "Malnovaj datumoj de ĉifroteĥnikaro troviĝis", + "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.": "Datumoj el malnova versio de Riot troviĝis. Ĉi tio malfunkciigos tutvojan ĉifradon en la malnova versio. Tutvoje ĉifritaj mesaĝoj interŝanĝitaj freŝtempe per la malnova versio eble ne malĉifreblos. Tio povas kaŭzi malsukceson ankaŭ al mesaĝoj interŝanĝitaj kun tiu ĉi versio. Se vin trafos problemoj, adiaŭu kaj resalutu. Por reteni mesaĝan historion, elportu kaj reenportu viajn ŝlosilojn.", "Logout": "Adiaŭi", "Your Communities": "Viaj komunumoj", "Error whilst fetching joined communities": "Akirado de viaj komunumoj eraris", @@ -576,8 +576,8 @@ "Success": "Sukceso", "Unable to remove contact information": "Ne povas forigi kontaktajn informojn", "": "", - "Import E2E room keys": "Enporti ĝiscele ĉifrajn ĉambrajn ŝlosilojn", - "Cryptography": "Kriptografio", + "Import E2E room keys": "Enporti tutvoje ĉifrajn ĉambrajn ŝlosilojn", + "Cryptography": "Ĉifroteĥnikaro", "Analytics": "Analizo", "Riot collects anonymous analytics to allow us to improve the application.": "Riot kolektas sennomaj analizajn datumojn por helpi plibonigadon de la programo.", "Labs": "Eksperimentaj funkcioj", @@ -981,7 +981,7 @@ "Room version": "Ĉambra versio", "Room version:": "Ĉambra versio:", "Developer options": "Programistaj elektebloj", - "Room Addresses": "Ĉambra adresoj", + "Room Addresses": "Adresoj de ĉambro", "Change room avatar": "Ŝanĝi profilbildon de ĉambro", "Change room name": "Ŝanĝi nomon de ĉambro", "Change main address for the room": "Ŝanĝi ĉefan adreson de la ĉambro", @@ -2400,5 +2400,10 @@ "Opens chat with the given user": "Malfermas babilon kun la uzanto", "Sends a message to the given user": "Sendas mesaĝon al la uzanto", "Waiting for your other session to verify…": "Atendante kontrolon de via alia salutaĵo…", - "You've successfully verified your device!": "Vi sukcese kontrolis vian aparaton!" + "You've successfully verified your device!": "Vi sukcese kontrolis vian aparaton!", + "To continue, use Single Sign On to prove your identity.": "Por daŭrigi, pruvu vian identecon per ununura saluto.", + "Confirm to continue": "Konfirmu por daŭrigi", + "Click the button below to confirm your identity.": "Klaku sube la butonon por konfirmi vian identecon.", + "Confirm encryption setup": "Konfirmi agordon de ĉifrado", + "Click the button below to confirm setting up encryption.": "Klaku sube la butonon por konfirmi agordon de ĉifrado." } From e96fa6db33f1817bc368f3c9a75e70a666ec9f40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Priit=20J=C3=B5er=C3=BC=C3=BCt?= Date: Thu, 14 May 2020 16:30:32 +0000 Subject: [PATCH 48/86] Translated using Weblate (Estonian) Currently translated at 46.9% (1082 of 2308 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/et/ --- src/i18n/strings/et.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/et.json b/src/i18n/strings/et.json index 948055c35a..b6e4830bf7 100644 --- a/src/i18n/strings/et.json +++ b/src/i18n/strings/et.json @@ -1082,5 +1082,8 @@ "Send a Direct Message": "Saada otsesõnum", "Are you sure you want to leave the room '%(roomName)s'?": "Kas oled kindel, et soovid lahkuda jututoast '%(roomName)s'?", "Unknown error": "Teadmata viga", - "To continue using the %(homeserverDomain)s homeserver you must review and agree to our terms and conditions.": "Selleka et jätkata koduserveri %(homeserverDomain)s kasutamist sa pead üle vaatama ja nõustuma meie kasutamistingimustega." + "To continue using the %(homeserverDomain)s homeserver you must review and agree to our terms and conditions.": "Selleka et jätkata koduserveri %(homeserverDomain)s kasutamist sa pead üle vaatama ja nõustuma meie kasutamistingimustega.", + "Permissions": "Õigused", + "Select the roles required to change various parts of the room": "Vali rollid, mis on vajalikud jututoa eri osade muutmiseks", + "Enable encryption?": "Kas võtame krüptimise kasutusele?" } From 9c04188ceb6ee66d492e79b5323f84f3f2ab4b93 Mon Sep 17 00:00:00 2001 From: Christian Paul Date: Thu, 14 May 2020 16:21:20 +0000 Subject: [PATCH 49/86] Translated using Weblate (German) Currently translated at 99.7% (2300 of 2308 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/de/ --- src/i18n/strings/de_DE.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/de_DE.json b/src/i18n/strings/de_DE.json index 7fdaf20e40..a7b7da4146 100644 --- a/src/i18n/strings/de_DE.json +++ b/src/i18n/strings/de_DE.json @@ -2365,5 +2365,8 @@ "Activate selected button": "Ausgewählten Button aktivieren", "Toggle right panel": "Rechtes Panel ein-/ausblenden", "Toggle this dialog": "Diesen Dialog ein-/ausblenden", - "Move autocomplete selection up/down": "Auto-Vervollständigung nach oben/unten verschieben" + "Move autocomplete selection up/down": "Auto-Vervollständigung nach oben/unten verschieben", + "Opens chat with the given user": "Öffnet einen Chat mit diesem Benutzer", + "Sends a message to the given user": "Sendet diesem Benutzer eine Nachricht", + "Waiting for your other session to verify…": "Warte auf die Verifikation deiner anderen Sitzungen…" } From f35a8bffc93f91ce11a513070b7cd9feb28a4f04 Mon Sep 17 00:00:00 2001 From: Christian Paul Date: Thu, 14 May 2020 16:32:26 +0000 Subject: [PATCH 50/86] Translated using Weblate (German) Currently translated at 100.0% (2309 of 2309 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/de/ --- src/i18n/strings/de_DE.json | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/i18n/strings/de_DE.json b/src/i18n/strings/de_DE.json index a7b7da4146..1166e7710a 100644 --- a/src/i18n/strings/de_DE.json +++ b/src/i18n/strings/de_DE.json @@ -1794,7 +1794,7 @@ "Confirm adding this email address by using Single Sign On to prove your identity.": "Bestätige das Hinzufügen dieser E-Mail-Adresse mit „Single Sign-On“, um deine Identität nachzuweisen.", "Single Sign On": "Single Sign-On", "Confirm adding email": "Bestätige das Hinzfugen der Email-Addresse", - "Confirm adding this phone number by using Single Sign On to prove your identity.": "Bestätige das Hinzufügen dieser Telefonnumer, indem du deine Identität mittels Single Sign-On nachweist.", + "Confirm adding this phone number by using Single Sign On to prove your identity.": "Bestätige das Hinzufügen dieser Telefonnummer, indem du deine Identität mittels „Single Sign-On“ nachweist.", "Click the button below to confirm adding this phone number.": "Betätige unten die Schaltfläche um das Hinzufügen dieser Telefonnummer zu bestätigen.", "If you cancel now, you won't complete your operation.": "Wenn du jetzt abbrichst, wirst du deinen Vorgang nicht fertigstellen.", "%(name)s is requesting verification": "%(name)s fordert eine Verifizierung an", @@ -2368,5 +2368,12 @@ "Move autocomplete selection up/down": "Auto-Vervollständigung nach oben/unten verschieben", "Opens chat with the given user": "Öffnet einen Chat mit diesem Benutzer", "Sends a message to the given user": "Sendet diesem Benutzer eine Nachricht", - "Waiting for your other session to verify…": "Warte auf die Verifikation deiner anderen Sitzungen…" + "Waiting for your other session to verify…": "Warte auf die Verifikation deiner anderen Sitzungen…", + "You've successfully verified your device!": "Du hast dein Gerät erfolgreich verifiziert!", + "QR Code": "QR-Code", + "To continue, use Single Sign On to prove your identity.": "Zum Fortfahren, nutze Single Sign On um deine Identität zu bestätigen.", + "Confirm to continue": "Bestätige um fortzufahren", + "Click the button below to confirm your identity.": "Klicke den Button unten um deine Identität zu bestätigen.", + "Confirm encryption setup": "Bestätige die Einrichtung der Verschlüsselung", + "Click the button below to confirm setting up encryption.": "Klick die Schaltfläche unten um die Einstellungen der Verschlüsselung zu bestätigen." } From 77df85b0ac2774d42b842c323c2f16822762cca3 Mon Sep 17 00:00:00 2001 From: Tentarial Date: Thu, 14 May 2020 16:36:58 +0000 Subject: [PATCH 51/86] Translated using Weblate (German) Currently translated at 100.0% (2309 of 2309 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/de/ --- src/i18n/strings/de_DE.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/strings/de_DE.json b/src/i18n/strings/de_DE.json index 1166e7710a..3600cb5148 100644 --- a/src/i18n/strings/de_DE.json +++ b/src/i18n/strings/de_DE.json @@ -1029,7 +1029,7 @@ "Please review and accept all of the homeserver's policies": "Bitte prüfen und akzeptieren Sie alle Richtlinien des Heimservers", "Failed to load group members": "Konnte Gruppenmitglieder nicht laden", "That doesn't look like a valid email address": "Sieht nicht nach einer validen E-Mail-Adresse aus", - "Unable to load commit detail: %(msg)s": "Konnte Commit-Details nicht laden: %(msg)s", + "Unable to load commit detail: %(msg)s": "Konnte Commit-Details nicht laden: %(msg)", "Checking...": "Überprüfe...", "Unable to load backup status": "Konnte Backupstatus nicht laden", "Failed to decrypt %(failedCount)s sessions!": "Konnte %(failedCount)s Sitzungen nicht entschlüsseln!", From 09a4af49f35f750ecb66021e35c0540ec227d018 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 14 May 2020 18:49:55 +0100 Subject: [PATCH 52/86] Consolidate zxcvbn progress bars into a component and add dynamic colour Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- res/css/_components.scss | 1 + res/css/views/auth/_AuthBody.scss | 18 ------- .../views/elements/_ZxcvbnProgressBar.scss | 52 +++++++++++++++++++ .../keybackup/CreateKeyBackupDialog.js | 3 +- .../CreateSecretStorageDialog.js | 3 +- src/components/views/auth/RegistrationForm.js | 7 +-- .../views/elements/ZxcvbnProgressBar.tsx | 30 +++++++++++ 7 files changed, 89 insertions(+), 25 deletions(-) create mode 100644 res/css/views/elements/_ZxcvbnProgressBar.scss create mode 100644 src/components/views/elements/ZxcvbnProgressBar.tsx diff --git a/res/css/_components.scss b/res/css/_components.scss index 428a28ac3a..671e156585 100644 --- a/res/css/_components.scss +++ b/res/css/_components.scss @@ -120,6 +120,7 @@ @import "./views/elements/_Tooltip.scss"; @import "./views/elements/_TooltipButton.scss"; @import "./views/elements/_Validation.scss"; +@import "./views/elements/_ZxcvbnProgressBar.scss"; @import "./views/emojipicker/_EmojiPicker.scss"; @import "./views/globals/_MatrixToolbar.scss"; @import "./views/groups/_GroupPublicityToggle.scss"; diff --git a/res/css/views/auth/_AuthBody.scss b/res/css/views/auth/_AuthBody.scss index 4b2d6b1bf1..f4967ce202 100644 --- a/res/css/views/auth/_AuthBody.scss +++ b/res/css/views/auth/_AuthBody.scss @@ -148,25 +148,7 @@ limitations under the License. } .mx_AuthBody_passwordScore { - width: 100%; - appearance: none; height: 4px; - border: 0; - border-radius: 2px; position: absolute; top: -12px; - - &::-moz-progress-bar { - border-radius: 2px; - background-color: $accent-color; - } - - &::-webkit-progress-bar, - &::-webkit-progress-value { - border-radius: 2px; - } - - &::-webkit-progress-value { - background-color: $accent-color; - } } diff --git a/res/css/views/elements/_ZxcvbnProgressBar.scss b/res/css/views/elements/_ZxcvbnProgressBar.scss new file mode 100644 index 0000000000..f7786348db --- /dev/null +++ b/res/css/views/elements/_ZxcvbnProgressBar.scss @@ -0,0 +1,52 @@ +/* +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. +*/ + +$PassphraseStrengthHigh: $accent-color; +$PassphraseStrengthMedium: $username-variant5-color; +$PassphraseStrengthLow: $notice-primary-color; + +@define-mixin ProgressBarColour $colour { + color: $colour; + &::-moz-progress-bar { + background-color: $colour; + } + &::-webkit-progress-value { + background-color: $colour; + } +} + +progress.mx_ZxcvbnProgressBar { + appearance: none; + width: 100%; + border: 0; + + border-radius: 2px; + &::-moz-progress-bar { + border-radius: 2px; + } + &::-webkit-progress-bar, + &::-webkit-progress-value { + border-radius: 2px; + } + + @mixin ProgressBarColour $PassphraseStrengthLow; + &[value="2"], &[value="3"] { + @mixin ProgressBarColour $PassphraseStrengthMedium; + } + &[value="4"] { + @mixin ProgressBarColour $PassphraseStrengthHigh; + } +} diff --git a/src/async-components/views/dialogs/keybackup/CreateKeyBackupDialog.js b/src/async-components/views/dialogs/keybackup/CreateKeyBackupDialog.js index e4e39400f6..df2a81263d 100644 --- a/src/async-components/views/dialogs/keybackup/CreateKeyBackupDialog.js +++ b/src/async-components/views/dialogs/keybackup/CreateKeyBackupDialog.js @@ -26,6 +26,7 @@ import { accessSecretStorage } from '../../../../CrossSigningManager'; import SettingsStore from '../../../../settings/SettingsStore'; import AccessibleButton from "../../../../components/views/elements/AccessibleButton"; import {copyNode} from "../../../../utils/strings"; +import ZxcvbnProgressBar from "../../../../components/views/elements/ZxcvbnProgressBar"; const PHASE_PASSPHRASE = 0; const PHASE_PASSPHRASE_CONFIRM = 1; @@ -276,7 +277,7 @@ export default class CreateKeyBackupDialog extends React.PureComponent {
; } strengthMeter =
- +
; } diff --git a/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js b/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js index c24623e30e..4c1faa3e6a 100644 --- a/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js +++ b/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js @@ -26,6 +26,7 @@ import Modal from '../../../../Modal'; import { promptForBackupPassphrase } from '../../../../CrossSigningManager'; import {copyNode} from "../../../../utils/strings"; import {SSOAuthEntry} from "../../../../components/views/auth/InteractiveAuthEntryComponents"; +import ZxcvbnProgressBar from "../../../../components/views/elements/ZxcvbnProgressBar"; const PHASE_LOADING = 0; const PHASE_LOADERROR = 1; @@ -529,7 +530,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent {
; } strengthMeter =
- +
; } diff --git a/src/components/views/auth/RegistrationForm.js b/src/components/views/auth/RegistrationForm.js index 2a79bb8588..663e30d44d 100644 --- a/src/components/views/auth/RegistrationForm.js +++ b/src/components/views/auth/RegistrationForm.js @@ -29,6 +29,7 @@ import SdkConfig from '../../../SdkConfig'; import { SAFE_LOCALPART_REGEX } from '../../../Registration'; import withValidation from '../elements/Validation'; import {ValidatedServerConfig} from "../../../utils/AutoDiscoveryUtils"; +import ZxcvbnProgressBar from "../elements/ZxcvbnProgressBar"; const FIELD_EMAIL = 'field_email'; const FIELD_PHONE_NUMBER = 'field_phone_number'; @@ -274,11 +275,7 @@ export default createReactClass({ description: function() { const complexity = this.state.passwordComplexity; const score = complexity ? complexity.score : 0; - return ; + return ; }, rules: [ { diff --git a/src/components/views/elements/ZxcvbnProgressBar.tsx b/src/components/views/elements/ZxcvbnProgressBar.tsx new file mode 100644 index 0000000000..339149b400 --- /dev/null +++ b/src/components/views/elements/ZxcvbnProgressBar.tsx @@ -0,0 +1,30 @@ +/* +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 classNames from "classnames"; + +interface IProps { + value: 0 | 1 | 2 | 3 | 4; + className?: string; +} + +const ZxcvbnProgressBar: React.FC = ({value, className}) => { + const classes = classNames("mx_ZxcvbnProgressBar", className); + return ; +}; + +export default ZxcvbnProgressBar; From 7ef456230479abd914f6aafbd54716007ad0a14f Mon Sep 17 00:00:00 2001 From: Tirifto Date: Thu, 14 May 2020 16:39:20 +0000 Subject: [PATCH 53/86] Translated using Weblate (Esperanto) Currently translated at 100.0% (2309 of 2309 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/eo/ --- src/i18n/strings/eo.json | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/i18n/strings/eo.json b/src/i18n/strings/eo.json index 11239303f8..6b3881339b 100644 --- a/src/i18n/strings/eo.json +++ b/src/i18n/strings/eo.json @@ -177,7 +177,7 @@ "Current password": "Nuna pasvorto", "Password": "Pasvorto", "New Password": "Nova pasvorto", - "Confirm password": "Konfirmi pasvorton", + "Confirm password": "Konfirmu pasvorton", "Change Password": "Ŝanĝi pasvorton", "Authentication": "Aŭtentikigo", "Device ID": "Aparata identigilo", @@ -298,7 +298,7 @@ "Only people who have been invited": "Nur invititaj uzantoj", "Anyone who knows the room's link, apart from guests": "Iu ajn kun la ligilo, krom gastoj", "Anyone who knows the room's link, including guests": "Iu ajn kun la ligilo, inkluzive gastojn", - "Publish this room to the public in %(domain)s's room directory?": "Ĉu publikigi ĉi tiun ĉambron al la publika ĉambrujo de %(domain)s?", + "Publish this room to the public in %(domain)s's room directory?": "Ĉu publikigi ĉi tiun ĉambron al la publika listo de ĉambroj de %(domain)s?", "Who can read history?": "Kiu povas legi la historion?", "Anyone": "Iu ajn", "Members only (since the point in time of selecting this option)": "Nur ĉambranoj (ekde ĉi tiu elekto)", @@ -441,7 +441,7 @@ "collapse": "maletendi", "expand": "etendi", "Custom level": "Propra nivelo", - "Room directory": "Ĉambra dosierujo", + "Room directory": "Listo de ĉambroj", "Username not available": "Uzantonomo ne disponeblas", "Username invalid: %(errMessage)s": "Uzantonomo ne validas: %(errMessage)s", "Username available": "Uzantonomo disponeblas", @@ -732,7 +732,7 @@ "No update available.": "Neniuj ĝisdatigoj haveblas.", "Resend": "Resendi", "Collecting app version information": "Kolektante informon pri versio de la aplikaĵo", - "Delete the room alias %(alias)s and remove %(name)s from the directory?": "Ĉu forigi la ĉambran kromnomon %(alias)s kaj forigi %(name)s de la ujo?", + "Delete the room alias %(alias)s and remove %(name)s from the directory?": "Ĉu forigi la ĉambran kromnomon %(alias)s kaj forigi %(name)s de la listo de ĉambroj?", "Enable notifications for this account": "Ŝalti sciigojn por tiu ĉi konto", "Invite to this community": "Inviti al tiu ĉi komunumo", "Messages containing keywords": "Mesaĝoj enhavantaj ŝlosilovortojn", @@ -1485,7 +1485,7 @@ "Homeserver URL does not appear to be a valid Matrix homeserver": "URL por hejmservilo ŝajne ne ligas al valida hejmservilo de Matrix", "Invalid identity server discovery response": "Nevalida eltrova respondo de identiga servilo", "Identity server URL does not appear to be a valid identity server": "URL por identiga servilo ŝajne ne ligas al valida identiga servilo", - "Sign in with single sign-on": "Salutu per ununura saluto", + "Sign in with single sign-on": "Saluti per ununura saluto", "Failed to re-authenticate due to a homeserver problem": "Malsukcesis reaŭtentikigi pro hejmservila problemo", "Failed to re-authenticate": "Malsukcesis reaŭtentikigi", "Enter your password to sign in and regain access to your account.": "Enigu vian pasvorton por saluti kaj rehavi aliron al via konto.", @@ -2405,5 +2405,6 @@ "Confirm to continue": "Konfirmu por daŭrigi", "Click the button below to confirm your identity.": "Klaku sube la butonon por konfirmi vian identecon.", "Confirm encryption setup": "Konfirmi agordon de ĉifrado", - "Click the button below to confirm setting up encryption.": "Klaku sube la butonon por konfirmi agordon de ĉifrado." + "Click the button below to confirm setting up encryption.": "Klaku sube la butonon por konfirmi agordon de ĉifrado.", + "QR Code": "Rapidresponda kodo" } From 2565f751839c65ac506c8d2e524030c2bfba1d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Priit=20J=C3=B5er=C3=BC=C3=BCt?= Date: Thu, 14 May 2020 16:34:16 +0000 Subject: [PATCH 54/86] Translated using Weblate (Estonian) Currently translated at 48.2% (1113 of 2309 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/et/ --- src/i18n/strings/et.json | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/et.json b/src/i18n/strings/et.json index b6e4830bf7..2ab308b469 100644 --- a/src/i18n/strings/et.json +++ b/src/i18n/strings/et.json @@ -1085,5 +1085,36 @@ "To continue using the %(homeserverDomain)s homeserver you must review and agree to our terms and conditions.": "Selleka et jätkata koduserveri %(homeserverDomain)s kasutamist sa pead üle vaatama ja nõustuma meie kasutamistingimustega.", "Permissions": "Õigused", "Select the roles required to change various parts of the room": "Vali rollid, mis on vajalikud jututoa eri osade muutmiseks", - "Enable encryption?": "Kas võtame krüptimise kasutusele?" + "Enable encryption?": "Kas võtame krüptimise kasutusele?", + "Once enabled, encryption for a room cannot be disabled. Messages sent in an encrypted room cannot be seen by the server, only by the participants of the room. Enabling encryption may prevent many bots and bridges from working correctly. Learn more about encryption.": "Kui kord juba kasutusele võetud, siis krüptimist enam hiljem ära lõpetada ei saa. Krüptitud sõnumeid ei saa lugeda ei vaheapealses veebiliikluses ega serveris ja vaid jututoa liikmed saavad neid lugeda. Krüptimise kasutusele võtmine takistada nii robotite kui sõnumisildade tööd. Lisateave krüptimise kohta.", + "Guests cannot join this room even if explicitly invited.": "Külalised ei saa selle jututoaga liituda ka siis, kui neid on otseselt kutsutud.", + "Click here to fix": "Parandamiseks klõpsi siia", + "Server error": "Serveri viga", + "Command error": "Käsu viga", + "Server unavailable, overloaded, or something else went wrong.": "Kas server pole saadaval, on üle koormatud või midagi muud läks viltu.", + "Unknown Command": "Tundmatu käsk", + "Unrecognised command: %(commandText)s": "Tundmatu käsk: %(commandText)s", + "Send as message": "Saada sõnumina", + "Failed to connect to integration manager": "Ühendus integratsioonihalduriga ei õnnestunud", + "You don't currently have any stickerpacks enabled": "Sul pole ühtegi kleepsupakki kasutusel", + "Add some now": "Lisa nüüd mõned", + "Stickerpack": "Kleepsupakk", + "Hide Stickers": "Peida kleepsud", + "Show Stickers": "Näita kleepse", + "Failed to revoke invite": "Kutse tühistamine ei õnnestunud", + "Could not revoke the invite. The server may be experiencing a temporary problem or you do not have sufficient permissions to revoke the invite.": "Kutse tühistamine ei õnnestunud. Serveri töös võib olla ajutine tõrge või sul pole piisavalt õigusi kutse tühistamiseks.", + "Revoke invite": "Tühista kutse", + "Invited by %(sender)s": "Kutsutud %(sender)s poolt", + "Jump to first unread message.": "Mine esimese lugemata sõnumi juurde.", + "Mark all as read": "Märgi kõik loetuks", + "Error updating main address": "Viga põhiaadressi uuendamisel", + "There was an error updating the room's main address. It may not be allowed by the server or a temporary failure occurred.": "Jututoa põhiaadressi uuendamisel tekkis viga. See kas pole serveris lubatud või tekkis mingi ajutine viga.", + "There was an error updating the room's alternative addresses. It may not be allowed by the server or a temporary failure occurred.": "Jututoa lisaaadressi uuendamisel tekkis viga. See kas pole serveris lubatud või tekkis mingi ajutine viga.", + "Error creating alias": "Viga aliase loomisel", + "There was an error creating that alias. It may not be allowed by the server or a temporary failure occurred.": "Aliase loomisel tekkis viga. See kas pole serveris lubatud või tekkis mingi ajutine viga.", + "You don't have permission to delete the alias.": "Sul pole õigusi aliase kustutamiseks.", + "There was an error removing that alias. It may no longer exist or a temporary error occurred.": "Selle aliase eemaldamisel tekkis viga. Teda kas pole enam olemas või tekkis mingi ajutine viga.", + "Error removing alias": "Viga aliase eemaldamisel", + "Main address": "Põhiaadress", + "not specified": "määratlemata" } From 13922a71d3fd15f44a0d10e4fcd6a232081c8f14 Mon Sep 17 00:00:00 2001 From: Christian Paul Date: Thu, 14 May 2020 16:48:38 +0000 Subject: [PATCH 55/86] Translated using Weblate (German) Currently translated at 100.0% (2309 of 2309 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/de/ --- src/i18n/strings/de_DE.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/strings/de_DE.json b/src/i18n/strings/de_DE.json index 3600cb5148..1166e7710a 100644 --- a/src/i18n/strings/de_DE.json +++ b/src/i18n/strings/de_DE.json @@ -1029,7 +1029,7 @@ "Please review and accept all of the homeserver's policies": "Bitte prüfen und akzeptieren Sie alle Richtlinien des Heimservers", "Failed to load group members": "Konnte Gruppenmitglieder nicht laden", "That doesn't look like a valid email address": "Sieht nicht nach einer validen E-Mail-Adresse aus", - "Unable to load commit detail: %(msg)s": "Konnte Commit-Details nicht laden: %(msg)", + "Unable to load commit detail: %(msg)s": "Konnte Commit-Details nicht laden: %(msg)s", "Checking...": "Überprüfe...", "Unable to load backup status": "Konnte Backupstatus nicht laden", "Failed to decrypt %(failedCount)s sessions!": "Konnte %(failedCount)s Sitzungen nicht entschlüsseln!", From 93a608a6446c6717a8b88d9f47ac71a096da0c20 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 14 May 2020 19:31:40 +0100 Subject: [PATCH 56/86] flatten out passwordSafe as it was a derived state value Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/auth/RegistrationForm.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/components/views/auth/RegistrationForm.js b/src/components/views/auth/RegistrationForm.js index 663e30d44d..4e2860c0cf 100644 --- a/src/components/views/auth/RegistrationForm.js +++ b/src/components/views/auth/RegistrationForm.js @@ -79,7 +79,6 @@ export default createReactClass({ password: this.props.defaultPassword || "", passwordConfirm: this.props.defaultPassword || "", passwordComplexity: null, - passwordSafe: false, }; }, @@ -291,22 +290,21 @@ export default createReactClass({ } const { scorePassword } = await import('../../../utils/PasswordScorer'); const complexity = scorePassword(value); - const safe = complexity.score >= PASSWORD_MIN_SCORE; - const allowUnsafe = SdkConfig.get()["dangerously_allow_unsafe_and_insecure_passwords"]; this.setState({ passwordComplexity: complexity, - passwordSafe: safe, }); + const safe = complexity.score >= PASSWORD_MIN_SCORE; + const allowUnsafe = SdkConfig.get()["dangerously_allow_unsafe_and_insecure_passwords"]; return allowUnsafe || safe; }, valid: function() { // Unsafe passwords that are valid are only possible through a // configuration flag. We'll print some helper text to signal // to the user that their password is allowed, but unsafe. - if (!this.state.passwordSafe) { - return _t("Password is allowed, but unsafe"); + if (this.state.passwordComplexity.score >= PASSWORD_MIN_SCORE) { + return _t("Nice, strong password!"); } - return _t("Nice, strong password!"); + return _t("Password is allowed, but unsafe"); }, invalid: function() { const complexity = this.state.passwordComplexity; From 8dd561d28a8a1fc39663a0bc138ac7e317e5f03b Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 14 May 2020 19:33:17 +0100 Subject: [PATCH 57/86] Convert Validation to TypeScript Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .../{Validation.js => Validation.tsx} | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) rename src/components/views/elements/{Validation.js => Validation.tsx} (87%) diff --git a/src/components/views/elements/Validation.js b/src/components/views/elements/Validation.tsx similarity index 87% rename from src/components/views/elements/Validation.js rename to src/components/views/elements/Validation.tsx index 2be526a3c3..09d6ec12f7 100644 --- a/src/components/views/elements/Validation.js +++ b/src/components/views/elements/Validation.tsx @@ -1,5 +1,6 @@ /* Copyright 2019 New Vector Ltd +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. @@ -15,11 +16,34 @@ limitations under the License. */ /* eslint-disable babel/no-invalid-this */ +import React from "react"; +import classNames from "classnames"; -import classNames from 'classnames'; +type Data = Pick; + +interface IRule { + key: string; + final?: boolean; + skip?(this: T, data: Data): boolean; + test(this: T, data: Data): boolean | Promise; + valid?(this: T): string; + invalid?(this: T): string; +} + +interface IArgs { + rules: IRule[]; + description(): React.ReactChild; +} + +interface IValidateArgs { + value: string; + focused: boolean; + allowEmpty: boolean; +} /** * Creates a validation function from a set of rules describing what to validate. + * Generic T is the "this" type passed to the rule methods * * @param {Function} description * Function that returns a string summary of the kind of value that will @@ -37,8 +61,8 @@ import classNames from 'classnames'; * A validation function that takes in the current input value and returns * the overall validity and a feedback UI that can be rendered for more detail. */ -export default function withValidation({ description, rules }) { - return async function onValidate({ value, focused, allowEmpty = true }) { +export default function withValidation({ description, rules }: IArgs) { + return async function onValidate({ value, focused, allowEmpty = true }: IValidateArgs) { if (!value && allowEmpty) { return { valid: null, From eb6796bd0eef258bbd278b247e3fd6d773efd6fe Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 14 May 2020 19:53:09 +0100 Subject: [PATCH 58/86] Migrate PasswordScorer to TypeScript Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/utils/{PasswordScorer.js => PasswordScorer.ts} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename src/utils/{PasswordScorer.js => PasswordScorer.ts} (98%) diff --git a/src/utils/PasswordScorer.js b/src/utils/PasswordScorer.ts similarity index 98% rename from src/utils/PasswordScorer.js rename to src/utils/PasswordScorer.ts index 9d89942bf5..d8f3b0fb96 100644 --- a/src/utils/PasswordScorer.js +++ b/src/utils/PasswordScorer.ts @@ -63,7 +63,7 @@ _td("Short keyboard patterns are easy to guess"); * @param {string} password Password to score * @returns {object} Score result with `score` and `feedback` properties */ -export function scorePassword(password) { +export function scorePassword(password: string) { if (password.length === 0) return null; const userInputs = ZXCVBN_USER_INPUTS.slice(); From cf3c4d9e5f53a387a60cad742b6304b7c39f5b14 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 14 May 2020 20:19:15 +0100 Subject: [PATCH 59/86] Extract Password field from Registration into a reusable component Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- package.json | 1 + res/css/_components.scss | 1 + res/css/views/auth/_AuthBody.scss | 6 - .../_PassphraseField.scss} | 7 +- src/components/views/auth/PassphraseField.tsx | 121 ++++++++++++++++++ src/components/views/auth/RegistrationForm.js | 63 +-------- src/components/views/elements/Validation.tsx | 13 +- yarn.lock | 5 + 8 files changed, 148 insertions(+), 69 deletions(-) rename res/css/views/{elements/_ZxcvbnProgressBar.scss => auth/_PassphraseField.scss} (92%) create mode 100644 src/components/views/auth/PassphraseField.tsx diff --git a/package.json b/package.json index 92d228a812..797b57d306 100644 --- a/package.json +++ b/package.json @@ -120,6 +120,7 @@ "@types/classnames": "^2.2.10", "@types/modernizr": "^3.5.3", "@types/react": "16.9", + "@types/zxcvbn": "^4.4.0", "babel-eslint": "^10.0.3", "babel-jest": "^24.9.0", "chokidar": "^3.3.1", diff --git a/res/css/_components.scss b/res/css/_components.scss index 671e156585..b871045fa1 100644 --- a/res/css/_components.scss +++ b/res/css/_components.scss @@ -41,6 +41,7 @@ @import "./views/auth/_CountryDropdown.scss"; @import "./views/auth/_InteractiveAuthEntryComponents.scss"; @import "./views/auth/_LanguageSelector.scss"; +@import "./views/auth/_PassphraseField.scss"; @import "./views/auth/_ServerConfig.scss"; @import "./views/auth/_ServerTypeSelector.scss"; @import "./views/auth/_Welcome.scss"; diff --git a/res/css/views/auth/_AuthBody.scss b/res/css/views/auth/_AuthBody.scss index f4967ce202..120da4c4f1 100644 --- a/res/css/views/auth/_AuthBody.scss +++ b/res/css/views/auth/_AuthBody.scss @@ -146,9 +146,3 @@ limitations under the License. .mx_AuthBody_spinner { margin: 1em 0; } - -.mx_AuthBody_passwordScore { - height: 4px; - position: absolute; - top: -12px; -} diff --git a/res/css/views/elements/_ZxcvbnProgressBar.scss b/res/css/views/auth/_PassphraseField.scss similarity index 92% rename from res/css/views/elements/_ZxcvbnProgressBar.scss rename to res/css/views/auth/_PassphraseField.scss index f7786348db..d810198213 100644 --- a/res/css/views/elements/_ZxcvbnProgressBar.scss +++ b/res/css/views/auth/_PassphraseField.scss @@ -18,6 +18,8 @@ $PassphraseStrengthHigh: $accent-color; $PassphraseStrengthMedium: $username-variant5-color; $PassphraseStrengthLow: $notice-primary-color; +.mx_PassphraseField {} + @define-mixin ProgressBarColour $colour { color: $colour; &::-moz-progress-bar { @@ -28,10 +30,13 @@ $PassphraseStrengthLow: $notice-primary-color; } } -progress.mx_ZxcvbnProgressBar { +progress.mx_PassphraseField_progress { appearance: none; width: 100%; border: 0; + height: 4px; + position: absolute; + top: -12px; border-radius: 2px; &::-moz-progress-bar { diff --git a/src/components/views/auth/PassphraseField.tsx b/src/components/views/auth/PassphraseField.tsx new file mode 100644 index 0000000000..425921cd7c --- /dev/null +++ b/src/components/views/auth/PassphraseField.tsx @@ -0,0 +1,121 @@ +/* +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, {PureComponent, RefCallback, RefObject} from "react"; +import classNames from "classnames"; +import zxcvbn from "zxcvbn"; + +import SdkConfig from "../../../SdkConfig"; +import withValidation, {IFieldState, IValidationResult} from "../elements/Validation"; +import {_t, _td} from "../../../languageHandler"; +import Field from "../elements/Field"; + +interface IProps { + id?: string; + className?: string; + minScore: 0 | 1 | 2 | 3 | 4; + value: string; + fieldRef: RefCallback | RefObject; + + label?: string; + labelEnterPassword?: string; + labelStrongPassword?: string; + labelAllowedButUnsafe?: string; + + onChange(ev: KeyboardEvent); + onValidate(result: IValidationResult); +} + +interface IState { + complexity: zxcvbn.ZXCVBNResult; +} + +class PassphraseField extends PureComponent { + static defaultProps = { + label: _td("Password"), + labelEnterPassword: _td("Enter password"), + labelStrongPassword: _td("Nice, strong password!"), + labelAllowedButUnsafe: _td("Password is allowed, but unsafe"), + }; + + public readonly validate = withValidation({ + description: function() { + const complexity = this.state.complexity; + const score = complexity ? complexity.score : 0; + return ; + }, + rules: [ + { + key: "required", + test: ({ value, allowEmpty }) => allowEmpty || !!value, + invalid: () => _t(this.props.labelEnterPassword), + }, + { + key: "complexity", + test: async function({ value }) { + if (!value) { + return false; + } + const { scorePassword } = await import('../../../utils/PasswordScorer'); + const complexity = scorePassword(value); + this.setState({ complexity }); + const safe = complexity.score >= this.props.minScore; + const allowUnsafe = SdkConfig.get()["dangerously_allow_unsafe_and_insecure_passwords"]; + return allowUnsafe || safe; + }, + valid: function() { + // Unsafe passwords that are valid are only possible through a + // configuration flag. We'll print some helper text to signal + // to the user that their password is allowed, but unsafe. + if (this.state.complexity.score >= this.props.minScore) { + return _t(this.props.labelStrongPassword); + } + return _t(this.props.labelAllowedButUnsafe); + }, + invalid: function() { + const complexity = this.state.complexity; + if (!complexity) { + return null; + } + const { feedback } = complexity; + return feedback.warning || feedback.suggestions[0] || _t("Keep going..."); + }, + }, + ], + }); + + onValidate = async (fieldState: IFieldState) => { + const result = await this.validate(fieldState); + this.props.onValidate(result); + return result; + }; + + render() { + return + } +} + +export default PassphraseField; diff --git a/src/components/views/auth/RegistrationForm.js b/src/components/views/auth/RegistrationForm.js index 4e2860c0cf..7bbd15d8d3 100644 --- a/src/components/views/auth/RegistrationForm.js +++ b/src/components/views/auth/RegistrationForm.js @@ -29,7 +29,7 @@ import SdkConfig from '../../../SdkConfig'; import { SAFE_LOCALPART_REGEX } from '../../../Registration'; import withValidation from '../elements/Validation'; import {ValidatedServerConfig} from "../../../utils/AutoDiscoveryUtils"; -import ZxcvbnProgressBar from "../elements/ZxcvbnProgressBar"; +import PassphraseField from "./PassphraseField"; const FIELD_EMAIL = 'field_email'; const FIELD_PHONE_NUMBER = 'field_phone_number'; @@ -264,60 +264,10 @@ export default createReactClass({ }); }, - async onPasswordValidate(fieldState) { - const result = await this.validatePasswordRules(fieldState); + onPasswordValidate(result) { this.markFieldValid(FIELD_PASSWORD, result.valid); - return result; }, - validatePasswordRules: withValidation({ - description: function() { - const complexity = this.state.passwordComplexity; - const score = complexity ? complexity.score : 0; - return ; - }, - rules: [ - { - key: "required", - test: ({ value, allowEmpty }) => allowEmpty || !!value, - invalid: () => _t("Enter password"), - }, - { - key: "complexity", - test: async function({ value }) { - if (!value) { - return false; - } - const { scorePassword } = await import('../../../utils/PasswordScorer'); - const complexity = scorePassword(value); - this.setState({ - passwordComplexity: complexity, - }); - const safe = complexity.score >= PASSWORD_MIN_SCORE; - const allowUnsafe = SdkConfig.get()["dangerously_allow_unsafe_and_insecure_passwords"]; - return allowUnsafe || safe; - }, - valid: function() { - // Unsafe passwords that are valid are only possible through a - // configuration flag. We'll print some helper text to signal - // to the user that their password is allowed, but unsafe. - if (this.state.passwordComplexity.score >= PASSWORD_MIN_SCORE) { - return _t("Nice, strong password!"); - } - return _t("Password is allowed, but unsafe"); - }, - invalid: function() { - const complexity = this.state.passwordComplexity; - if (!complexity) { - return null; - } - const { feedback } = complexity; - return feedback.warning || feedback.suggestions[0] || _t("Keep going..."); - }, - }, - ], - }), - onPasswordConfirmChange(ev) { this.setState({ passwordConfirm: ev.target.value, @@ -479,13 +429,10 @@ export default createReactClass({ }, renderPassword() { - const Field = sdk.getComponent('elements.Field'); - return this[FIELD_PASSWORD] = field} - type="password" - autoComplete="new-password" - label={_t("Password")} + fieldRef={field => this[FIELD_PASSWORD] = field} + minScore={PASSWORD_MIN_SCORE} value={this.state.password} onChange={this.onPasswordChange} onValidate={this.onPasswordValidate} diff --git a/src/components/views/elements/Validation.tsx b/src/components/views/elements/Validation.tsx index 09d6ec12f7..50544c9f51 100644 --- a/src/components/views/elements/Validation.tsx +++ b/src/components/views/elements/Validation.tsx @@ -19,7 +19,7 @@ limitations under the License. import React from "react"; import classNames from "classnames"; -type Data = Pick; +type Data = Pick; interface IRule { key: string; @@ -32,15 +32,20 @@ interface IRule { interface IArgs { rules: IRule[]; - description(): React.ReactChild; + description(this: T): React.ReactChild; } -interface IValidateArgs { +export interface IFieldState { value: string; focused: boolean; allowEmpty: boolean; } +export interface IValidationResult { + valid?: boolean; + feedback?: React.ReactChild; +} + /** * Creates a validation function from a set of rules describing what to validate. * Generic T is the "this" type passed to the rule methods @@ -62,7 +67,7 @@ interface IValidateArgs { * the overall validity and a feedback UI that can be rendered for more detail. */ export default function withValidation({ description, rules }: IArgs) { - return async function onValidate({ value, focused, allowEmpty = true }: IValidateArgs) { + return async function onValidate({ value, focused, allowEmpty = true }: IFieldState): Promise { if (!value && allowEmpty) { return { valid: null, diff --git a/yarn.lock b/yarn.lock index 520e976b17..b2c703c0d8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1318,6 +1318,11 @@ dependencies: "@types/yargs-parser" "*" +"@types/zxcvbn@^4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@types/zxcvbn/-/zxcvbn-4.4.0.tgz#fbc1d941cc6d9d37d18405c513ba6b294f89b609" + integrity sha512-GQLOT+SN20a+AI51y3fAimhyTF4Y0RG+YP3gf91OibIZ7CJmPFgoZi+ZR5a+vRbS01LbQosITWum4ATmJ1Z6Pg== + "@typescript-eslint/experimental-utils@^2.5.0": version "2.27.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.27.0.tgz#801a952c10b58e486c9a0b36cf21e2aab1e9e01a" From 865495dd695293fa5c8cc9ee17bb24dfdc66d097 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 14 May 2020 20:33:50 +0100 Subject: [PATCH 60/86] replace zxcvbn field in CreateSecretStorageDialog with PassphraseField Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .../_CreateSecretStorageDialog.scss | 11 -- .../CreateSecretStorageDialog.js | 106 +++++------------- src/components/views/auth/PassphraseField.tsx | 6 +- 3 files changed, 36 insertions(+), 87 deletions(-) diff --git a/res/css/views/dialogs/secretstorage/_CreateSecretStorageDialog.scss b/res/css/views/dialogs/secretstorage/_CreateSecretStorageDialog.scss index a9ebd54b31..63e5a3de09 100644 --- a/res/css/views/dialogs/secretstorage/_CreateSecretStorageDialog.scss +++ b/res/css/views/dialogs/secretstorage/_CreateSecretStorageDialog.scss @@ -68,17 +68,6 @@ limitations under the License. margin-top: 0px; } -.mx_CreateSecretStorageDialog_passPhraseHelp { - flex: 1; - height: 64px; - margin-left: 20px; - font-size: 80%; -} - -.mx_CreateSecretStorageDialog_passPhraseHelp progress { - width: 100%; -} - .mx_CreateSecretStorageDialog_passPhraseMatch { width: 200px; margin-left: 20px; diff --git a/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js b/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js index 4c1faa3e6a..b77c71d08c 100644 --- a/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js +++ b/src/async-components/views/dialogs/secretstorage/CreateSecretStorageDialog.js @@ -15,18 +15,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React from 'react'; +import React, {createRef} from 'react'; import PropTypes from 'prop-types'; import * as sdk from '../../../../index'; import {MatrixClientPeg} from '../../../../MatrixClientPeg'; -import { scorePassword } from '../../../../utils/PasswordScorer'; import FileSaver from 'file-saver'; -import { _t } from '../../../../languageHandler'; +import {_t, _td} from '../../../../languageHandler'; import Modal from '../../../../Modal'; import { promptForBackupPassphrase } from '../../../../CrossSigningManager'; import {copyNode} from "../../../../utils/strings"; import {SSOAuthEntry} from "../../../../components/views/auth/InteractiveAuthEntryComponents"; -import ZxcvbnProgressBar from "../../../../components/views/elements/ZxcvbnProgressBar"; +import PassphraseField from "../../../../components/views/auth/PassphraseField"; const PHASE_LOADING = 0; const PHASE_LOADERROR = 1; @@ -40,7 +39,6 @@ const PHASE_DONE = 8; const PHASE_CONFIRM_SKIP = 9; const PASSWORD_MIN_SCORE = 4; // So secure, many characters, much complex, wow, etc, etc. -const PASSPHRASE_FEEDBACK_DELAY = 500; // How long after keystroke to offer passphrase feedback, ms. /* * Walks the user through the process of creating a passphrase to guard Secure @@ -69,10 +67,10 @@ export default class CreateSecretStorageDialog extends React.PureComponent { this.state = { phase: PHASE_LOADING, passPhrase: '', + passPhraseValid: false, passPhraseConfirm: '', copied: false, downloaded: false, - zxcvbnResult: null, backupInfo: null, backupSigStatus: null, // does the server offer a UI auth flow with just m.login.password @@ -84,6 +82,8 @@ export default class CreateSecretStorageDialog extends React.PureComponent { useKeyBackup: true, }; + this._passphraseField = createRef(); + this._fetchBackupInfo(); if (this.state.accountPassword) { // If we have an account password in memory, let's simplify and @@ -365,22 +365,16 @@ export default class CreateSecretStorageDialog extends React.PureComponent { _onPassPhraseNextClick = async (e) => { e.preventDefault(); + if (!this._passphraseField.current) return; // unmounting - // If we're waiting for the timeout before updating the result at this point, - // skip ahead and do it now, otherwise we'll deny the attempt to proceed - // even if the user entered a valid passphrase - if (this._setZxcvbnResultTimeout !== null) { - clearTimeout(this._setZxcvbnResultTimeout); - this._setZxcvbnResultTimeout = null; - await new Promise((resolve) => { - this.setState({ - zxcvbnResult: scorePassword(this.state.passPhrase), - }, resolve); - }); - } - if (this._passPhraseIsValid()) { - this.setState({phase: PHASE_PASSPHRASE_CONFIRM}); + await this._passphraseField.current.validate({ allowEmpty: false }); + if (!this._passphraseField.current.state.valid) { + this._passphraseField.current.focus(); + this._passphraseField.current.validate({ allowEmpty: false, focused: true }); + return; } + + this.setState({phase: PHASE_PASSPHRASE_CONFIRM}); }; _onPassPhraseConfirmNextClick = async (e) => { @@ -400,9 +394,9 @@ export default class CreateSecretStorageDialog extends React.PureComponent { _onSetAgainClick = () => { this.setState({ passPhrase: '', + passPhraseValid: false, passPhraseConfirm: '', phase: PHASE_PASSPHRASE, - zxcvbnResult: null, }); } @@ -412,23 +406,16 @@ export default class CreateSecretStorageDialog extends React.PureComponent { }); } + _onPassPhraseValidate = (result) => { + this.setState({ + passPhraseValid: result.valid, + }); + }; + _onPassPhraseChange = (e) => { this.setState({ passPhrase: e.target.value, }); - - if (this._setZxcvbnResultTimeout !== null) { - clearTimeout(this._setZxcvbnResultTimeout); - } - this._setZxcvbnResultTimeout = setTimeout(() => { - this._setZxcvbnResultTimeout = null; - this.setState({ - // precompute this and keep it in state: zxcvbn is fast but - // we use it in a couple of different places so no point recomputing - // it unnecessarily. - zxcvbnResult: scorePassword(this.state.passPhrase), - }); - }, PASSPHRASE_FEEDBACK_DELAY); } _onPassPhraseConfirmChange = (e) => { @@ -437,10 +424,6 @@ export default class CreateSecretStorageDialog extends React.PureComponent { }); } - _passPhraseIsValid() { - return this.state.zxcvbnResult && this.state.zxcvbnResult.score >= PASSWORD_MIN_SCORE; - } - _onAccountPasswordChange = (e) => { this.setState({ accountPassword: e.target.value, @@ -503,37 +486,9 @@ export default class CreateSecretStorageDialog extends React.PureComponent { _renderPhasePassPhrase() { const DialogButtons = sdk.getComponent('views.elements.DialogButtons'); - const Field = sdk.getComponent('views.elements.Field'); const AccessibleButton = sdk.getComponent('elements.AccessibleButton'); const LabelledToggleSwitch = sdk.getComponent('views.elements.LabelledToggleSwitch'); - let strengthMeter; - let helpText; - if (this.state.zxcvbnResult) { - if (this.state.zxcvbnResult.score >= PASSWORD_MIN_SCORE) { - helpText = _t("Great! This recovery passphrase looks strong enough."); - } else { - // We take the warning from zxcvbn or failing that, the first - // suggestion. In practice The first is generally the most relevant - // and it's probably better to present the user with one thing to - // improve about their password than a whole collection - it can - // spit out a warning and multiple suggestions which starts getting - // very information-dense. - const suggestion = ( - this.state.zxcvbnResult.feedback.warning || - this.state.zxcvbnResult.feedback.suggestions[0] - ); - const suggestionBlock =
{suggestion || _t("Keep going...")}
; - - helpText =
- {suggestionBlock} -
; - } - strengthMeter =
- -
; - } - return

{_t( "Set a recovery passphrase to secure encrypted information and recover it if you log out. " + @@ -541,19 +496,20 @@ export default class CreateSecretStorageDialog extends React.PureComponent { )}

- -
- {strengthMeter} - {helpText} -
.": "Mitte midagi ei kuvata? Kõik Matrix'i kliendid ei toeta veel interaktiivset verifitseerimist. .", + "Waiting for %(userId)s to confirm...": "Ootan kinnitust kasutajalt %(userId)s…", + "Skip": "Jäta vahele", + "Token incorrect": "Vigane tunnusluba" } From 7c5842c208fe08b9e48964214663a447216bc928 Mon Sep 17 00:00:00 2001 From: Xose M Date: Sun, 17 May 2020 09:37:45 +0000 Subject: [PATCH 78/86] Translated using Weblate (Galician) Currently translated at 40.0% (925 of 2312 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/gl/ --- src/i18n/strings/gl.json | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/i18n/strings/gl.json b/src/i18n/strings/gl.json index 346dda09f2..3328292be0 100644 --- a/src/i18n/strings/gl.json +++ b/src/i18n/strings/gl.json @@ -698,9 +698,9 @@ "Failed to remove tag %(tagName)s from room": "Fallo ao eliminar a etiqueta %(tagName)s da sala", "Failed to add tag %(tagName)s to room": "Fallo ao engadir a etiqueta %(tagName)s a sala", "Key request sent.": "Petición de chave enviada.", - "Flair": "Aura", - "Showing flair for these communities:": "Mostrar a aura para estas comunidades:", - "Display your community flair in rooms configured to show it.": "Mostrar a aura da súa comunidade nas salas configuradas para que a mostren.", + "Flair": "Popularidade", + "Showing flair for these communities:": "Mostrar a popularidade destas comunidades:", + "Display your community flair in rooms configured to show it.": "Mostrar a popularidade da túa comunidade nas salas configuradas para que a mostren.", "Did you know: you can use communities to filter your Riot.im experience!": "Sabía que pode utilizar as comunidades para mellorar a súa experiencia con Riot.im!", "To set up a filter, drag a community avatar over to the filter panel on the far left hand side of the screen. You can click on an avatar in the filter panel at any time to see only the rooms and people associated with that community.": "Para establecer un filtro, arrastre un avatar da comunidade sobre o panel de filtros na parte esquerda da pantalla. Pode pulsar nun avatar no panel de filtrado en calquera momento para ver só salas e xente asociada a esa comunidade.", "Deops user with given id": "Degradar o usuario con esa ID", @@ -822,7 +822,7 @@ "Debug logs contain application usage data including your username, the IDs or aliases of the rooms or groups you have visited and the usernames of other users. They do not contain messages.": "Os informes de depuración conteñen datos de utilización do aplicativo como o seu nome de usuario, os IDs ou alcumes de salas e grupos que vostede visitou e os nomes de usuarios doutras usuarias. Non conteñen mensaxes.", "Unhide Preview": "Desagochar a vista previa", "Unable to join network": "Non se puido conectar a rede", - "You might have configured them in a client other than Riot. You cannot tune them in Riot but they still apply": "Pode que os configurase nun cliente diferente de Riot. Non pode establecelos desde Riot pero aínda así aplicaranse", + "You might have configured them in a client other than Riot. You cannot tune them in Riot but they still apply": "Pode que os configurases nun cliente diferente de Riot. Non podes establecelos desde Riot pero aínda así aplicaranse", "Sorry, your browser is not able to run Riot.": "Desculpe, o seu navegador non pode executar Riot.", "Uploaded on %(date)s by %(user)s": "Subido a %(date)s por %(user)s", "Messages in group chats": "Mensaxes en grupos de chat", @@ -919,5 +919,23 @@ "Your message wasn't sent because this homeserver has hit its Monthly Active User Limit. Please contact your service administrator to continue using the service.": "A súa mensaxe non foi enviada porque este servidor acadou o Límite Mensual de Usuaria Activa. Por favor contacte coa administración do servizo para continuar utilizando o servizo.", "Your message wasn't sent because this homeserver has exceeded a resource limit. Please contact your service administrator to continue using the service.": "A súa mensaxe non foi enviada porque o servidor superou o límite de recursos. Por favor contacte coa administración do servizo para continuar utilizando o servizo.", "Legal": "Legal", - "Please contact your service administrator to continue using this service.": "Por favor contacte coa administración do servizo para continuar utilizando o servizo." + "Please contact your service administrator to continue using this service.": "Por favor contacte coa administración do servizo para continuar utilizando o servizo.", + "Use Single Sign On to continue": "Usar Single Sign On para continuar", + "Confirm adding this email address by using Single Sign On to prove your identity.": "Confirma que queres engadir este email usando Single Sign On como proba de identidade.", + "Single Sign On": "Single Sign On", + "Confirm adding email": "Confirma novo email", + "Click the button below to confirm adding this email address.": "Preme no botón inferior para confirmar que queres engadir o email.", + "Confirm": "Confirmar", + "Add Email Address": "Engadir email", + "Confirm adding this phone number by using Single Sign On to prove your identity.": "Confirma que queres engadir este teléfono usando Single Sign On como proba de identidade.", + "Confirm adding phone number": "Confirma a adición do teléfono", + "Click the button below to confirm adding this phone number.": "Preme no botón inferior para confirmar que engades este número.", + "Add Phone Number": "Engadir novo Número", + "The version of Riot": "A versión de Riot", + "Whether or not you're logged in (we don't record your username)": "Se estás conectada ou non (non rexistramos o teu nome de usuaria)", + "Whether you're using Riot on a device where touch is the primary input mechanism": "Se estás conectada utilizando Riot nun dispositivo maiormente táctil", + "Whether you're using Riot as an installed Progressive Web App": "Se estás a usar Riot como unha Progressive Web App instalada", + "Your user agent": "User Agent do navegador", + "The information being sent to us to help make Riot better includes:": "Información que nos envías para mellorar Riot inclúe:", + "Please install Chrome, Firefox, or Safari for the best experience.": "Instala Chrome, Firefox, ou Safari para ter unha mellor experiencia." } From 5ea4cc1c5b209b5ea8b3401ea3cabf80a20da11a Mon Sep 17 00:00:00 2001 From: yuuki-san Date: Mon, 18 May 2020 08:31:13 +0000 Subject: [PATCH 79/86] Translated using Weblate (Slovak) Currently translated at 62.3% (1441 of 2312 strings) Translation: Riot Web/matrix-react-sdk Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/sk/ --- src/i18n/strings/sk.json | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/i18n/strings/sk.json b/src/i18n/strings/sk.json index fbecaa4845..e85732ed82 100644 --- a/src/i18n/strings/sk.json +++ b/src/i18n/strings/sk.json @@ -628,7 +628,7 @@ "Export room keys": "Exportovať kľúče miestností", "This process allows you to export the keys for messages you have received in encrypted rooms to a local file. You will then be able to import the file into another Matrix client in the future, so that client will also be able to decrypt these messages.": "Tento proces vás prevedie exportom kľúčov určených na dešifrovanie správ, ktoré ste dostali v šifrovaných miestnostiach do lokálneho súboru. Tieto kľúče zo súboru môžete neskôr importovať do iného Matrix klienta, aby ste v ňom mohli dešifrovať vaše šifrované správy.", "The exported file will allow anyone who can read it to decrypt any encrypted messages that you can see, so you should be careful to keep it secure. To help with this, you should enter a passphrase below, which will be used to encrypt the exported data. It will only be possible to import the data by using the same passphrase.": "Tento súbor umožní komukoľvek, k to má ku nemu prístup dešifrovať všetky vami viditeľné šifrované správy, mali by ste teda byť opatrní a tento súbor si bezpečne uchovať. Aby bolo toto pre vás jednoduchšie, nižšie zadajte heslo, ktorým budú údaje v súbore zašifrované. Importovať údaje zo súboru bude možné len po zadaní tohoto istého hesla.", - "Enter passphrase": "Zadajte heslo", + "Enter passphrase": "Zadajte (dlhé) heslo", "Confirm passphrase": "Potvrďte heslo", "Export": "Exportovať", "Import room keys": "Importovať kľúče miestností", @@ -1519,5 +1519,17 @@ "Whether you're using Riot on a device where touch is the primary input mechanism": "Či používate Riot na zariadení, ktorého hlavným vstupným mechanizmom je dotyk (mobil, tablet,...)", "Whether you're using Riot as an installed Progressive Web App": "Či používate Riot ako nainštalovanú Progresívnu Webovú Aplikáciu", "Your user agent": "Identifikátor vášho prehliadača", - "The information being sent to us to help make Riot better includes:": "Informácie, ktoré nám posielate, aby sme zlepšili Riot, zahŕňajú:" + "The information being sent to us to help make Riot better includes:": "Informácie, ktoré nám posielate, aby sme zlepšili Riot, zahŕňajú:", + "There are unknown sessions in this room: if you proceed without verifying them, it will be possible for someone to eavesdrop on your call.": "V miestnosti je neznáma relácia: pokiaľ budete pokračovať bez jej overenia, bude schopná odpočúvať váš hovor.", + "Review Sessions": "Overiť reláciu", + "If you cancel now, you won't complete verifying the other user.": "Pokiaľ teraz proces zrušíte, nedokončíte overenie druhého používateľa.", + "If you cancel now, you won't complete verifying your other session.": "Pokiaľ teraz proces zrušíte, nedokončíte overenie vašej druhej relácie.", + "If you cancel now, you won't complete your operation.": "Pokiaľ teraz proces zrušíte, nedokončíte ho.", + "Cancel entering passphrase?": "Zrušiť zadávanie (dlhého) hesla.", + "Setting up keys": "Príprava kľúčov", + "Verify this session": "Overiť túto reláciu", + "Keep recovery passphrase in memory for this session": "Ponechať (dlhé) heslo pre obnovu zálohy v pamäti pre túto reláciu", + "Enter recovery passphrase": "Zadajte (dlhé) heslo pre obnovu zálohy", + "Unable to access secret storage. Please verify that you entered the correct recovery passphrase.": "Nemožno sa dostať do tajného úložiska. Prosím, overte, že ste zadali správne (dlhé) heslo pre obnovu zálohy.", + "Access your secure message history and your cross-signing identity for verifying other sessions by entering your recovery passphrase.": "Získajte prístup k vašej zabezpečenej histórií správ a vašemu krížom-podpísanej identite na potvrdenie iných relácií zadaním vášho (dlhého) hesla na obnovu zálohy." } From b6ac8cb28d92822ea1cf128fd46b687113e1a74d Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@googlemail.com> Date: Wed, 13 May 2020 06:36:14 +0100 Subject: [PATCH 80/86] Revert "ImageView make clicking off it easier" (cherry picked from commit 52e3c97f8c9a2032fe92b2b4bb5fc68c0f6957b5) --- res/css/views/elements/_ImageView.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/css/views/elements/_ImageView.scss b/res/css/views/elements/_ImageView.scss index 983ef074f2..0a4ed2a194 100644 --- a/res/css/views/elements/_ImageView.scss +++ b/res/css/views/elements/_ImageView.scss @@ -37,7 +37,7 @@ limitations under the License. order: 2; /* min-width hack needed for FF */ min-width: 0px; - max-height: 90%; + height: 90%; flex: 15 15 0; display: flex; align-items: center; From a864643d98197ae6bc3bf34c8ee3da4c4a94a013 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 18 May 2020 10:37:02 +0100 Subject: [PATCH 81/86] Label the create room button something better than "Add room" Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/rooms/RoomList.js | 1 + src/i18n/strings/en_EN.json | 1 + 2 files changed, 2 insertions(+) diff --git a/src/components/views/rooms/RoomList.js b/src/components/views/rooms/RoomList.js index 289a89a206..c46b946b5c 100644 --- a/src/components/views/rooms/RoomList.js +++ b/src/components/views/rooms/RoomList.js @@ -785,6 +785,7 @@ export default createReactClass({ label: _t('Rooms'), incomingCall: incomingCallIfTaggedAs('im.vector.fake.recent'), onAddRoom: () => {dis.dispatch({action: 'view_create_room'});}, + addRoomLabel: _t("Create room"), }, ]; const tagSubLists = Object.keys(this.state.lists) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index f16a0d7755..c9ac768b3e 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1113,6 +1113,7 @@ "Direct Messages": "Direct Messages", "Start chat": "Start chat", "Rooms": "Rooms", + "Create room": "Create room", "Low priority": "Low priority", "Historical": "Historical", "System Alerts": "System Alerts", From 406839e89a43a559e6529c32998e40f8d5a77f21 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Tue, 19 May 2020 11:13:57 +0100 Subject: [PATCH 82/86] Upgrade matrix-js-sdk to 6.1.0 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 8338a91bf7..99e0399d8e 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "is-ip": "^2.0.0", "linkifyjs": "^2.1.6", "lodash": "^4.17.14", - "matrix-js-sdk": "6.1.0-rc.1", + "matrix-js-sdk": "6.1.0", "minimist": "^1.2.0", "pako": "^1.0.5", "parse5": "^5.1.1", diff --git a/yarn.lock b/yarn.lock index d05c444470..0edea5433e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5720,10 +5720,10 @@ mathml-tag-names@^2.0.1: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== -matrix-js-sdk@6.1.0-rc.1: - version "6.1.0-rc.1" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-6.1.0-rc.1.tgz#521d5683d10e49bb437b2457d1f0c6696fc7a4e3" - integrity sha512-q3XScyroUwY3qTBglRgE1lldfrLlSML5nU4gJzXrEwn2gGpR1P4IU8aT8EcumyOmeZhrrysS2UEE9fWgUmhkBw== +matrix-js-sdk@6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-6.1.0.tgz#c28ad67c113c4aa9c8bce409c7ba550170bdc2ee" + integrity sha512-N+vCgxWORvhh7AGyWZlU5Z2brojbbnHnWlMkBF6JjWe6a+pfpjmRKp5/jeQpOz6yfe56sIQvU7ikBZl3JjlMiw== dependencies: "@babel/runtime" "^7.8.3" another-json "^0.2.0" From bc8a53a7d797a513bf0fb2c000fd63cc7e90f4a8 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Tue, 19 May 2020 11:21:59 +0100 Subject: [PATCH 83/86] Prepare changelog for v2.6.0 --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c34bfba87b..7901062b89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +Changes in [2.6.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v2.6.0) (2020-05-19) +=================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v2.6.0-rc.1...v2.6.0) + + * Upgrade to JS SDK 6.1.0 + * Revert "ImageView make clicking off it easier" + [\#4602](https://github.com/matrix-org/matrix-react-sdk/pull/4602) + * Remove debugging that causes email addresses to load forever (to release) + [\#4598](https://github.com/matrix-org/matrix-react-sdk/pull/4598) + Changes in [2.6.0-rc.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v2.6.0-rc.1) (2020-05-14) ============================================================================================================= [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v2.5.0...v2.6.0-rc.1) From 26e6447be5331614668b0d0e3ae516a0988ef9bc Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Tue, 19 May 2020 11:22:00 +0100 Subject: [PATCH 84/86] v2.6.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 99e0399d8e..28f3d1633c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "2.6.0-rc.1", + "version": "2.6.0", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { From 833eccf5cd901d04ddfcc06a7f95e2e2ebe6f5d5 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Tue, 19 May 2020 11:25:07 +0100 Subject: [PATCH 85/86] Reset matrix-js-sdk back to develop branch --- package.json | 2 +- yarn.lock | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 3bdda8a583..7c008d5ccc 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "is-ip": "^2.0.0", "linkifyjs": "^2.1.6", "lodash": "^4.17.14", - "matrix-js-sdk": "6.1.0", + "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop", "minimist": "^1.2.0", "pako": "^1.0.5", "parse5": "^5.1.1", diff --git a/yarn.lock b/yarn.lock index b7e5017fd7..93118dab22 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1285,6 +1285,13 @@ resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw== +"@types/qrcode@^1.3.4": + version "1.3.4" + resolved "https://registry.yarnpkg.com/@types/qrcode/-/qrcode-1.3.4.tgz#984d97bb72caa558d470158701081ccb712f616b" + integrity sha512-aILE5yvKaqQXlY0YPMEYwK/KwdD43fwQTyagj0ffBBTQj8h//085Zp8LUrOnZ9FT69x64f5UgDo0EueY4BPAdg== + dependencies: + "@types/node" "*" + "@types/react@*": version "16.9.35" resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.35.tgz#a0830d172e8aadd9bd41709ba2281a3124bbd368" @@ -1293,13 +1300,6 @@ "@types/prop-types" "*" csstype "^2.2.0" -"@types/qrcode@^1.3.4": - version "1.3.4" - resolved "https://registry.yarnpkg.com/@types/qrcode/-/qrcode-1.3.4.tgz#984d97bb72caa558d470158701081ccb712f616b" - integrity sha512-aILE5yvKaqQXlY0YPMEYwK/KwdD43fwQTyagj0ffBBTQj8h//085Zp8LUrOnZ9FT69x64f5UgDo0EueY4BPAdg== - dependencies: - "@types/node" "*" - "@types/react@16.9": version "16.9.32" resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.32.tgz#f6368625b224604148d1ddf5920e4fefbd98d383" @@ -5753,10 +5753,9 @@ mathml-tag-names@^2.0.1: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== -matrix-js-sdk@6.1.0: +"matrix-js-sdk@github:matrix-org/matrix-js-sdk#develop": version "6.1.0" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-6.1.0.tgz#c28ad67c113c4aa9c8bce409c7ba550170bdc2ee" - integrity sha512-N+vCgxWORvhh7AGyWZlU5Z2brojbbnHnWlMkBF6JjWe6a+pfpjmRKp5/jeQpOz6yfe56sIQvU7ikBZl3JjlMiw== + resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/e3c6a0e1a08a3812ba988e60eb5a2a013bb27404" dependencies: "@babel/runtime" "^7.8.3" another-json "^0.2.0" From 4bf2e5fd8eaafe22533e5e3a02752a9d2251d129 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 19 May 2020 15:40:26 +0100 Subject: [PATCH 86/86] Remove SSSS key upgrade check from rageshake This code doesn't exist anymore as the SSSS symmetric upgrade stuff has been removed. Fixes https://github.com/vector-im/riot-web/issues/13715 --- src/rageshake/submit-rageshake.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/rageshake/submit-rageshake.ts b/src/rageshake/submit-rageshake.ts index e5027e0d37..9f9d7898cb 100644 --- a/src/rageshake/submit-rageshake.ts +++ b/src/rageshake/submit-rageshake.ts @@ -133,7 +133,6 @@ export default async function sendBugReport(bugReportEndpoint: string, opts: IOp body.append("cross_signing_supported_by_hs", String(await client.doesServerSupportUnstableFeature("org.matrix.e2e_cross_signing"))); body.append("cross_signing_ready", String(await client.isCrossSigningReady())); - body.append("ssss_key_needs_upgrade", String(await client.secretStorageKeyNeedsUpgrade())); } }