⚠️ {_t(
- "Backup key stored in secret storage, but this feature is not " +
- "enabled on this session. Please enable cross-signing in Labs to " +
- "modify key backup state.",
- )}
;
- }
return
{clientBackupStatus}
diff --git a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js
index bed057f03d..a410617631 100644
--- a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js
+++ b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js
@@ -306,9 +306,7 @@ export default class SecurityUserSettingsTab extends React.Component {
// in having advanced details here once all flows are implemented, we
// can remove this.
const CrossSigningPanel = sdk.getComponent('views.settings.CrossSigningPanel');
- let crossSigning;
- if (SettingsStore.getValue("feature_cross_signing")) {
- crossSigning = (
+ const crossSigning = (
{_t("Cross-signing")}
@@ -316,7 +314,6 @@ export default class SecurityUserSettingsTab extends React.Component {
);
- }
const E2eAdvancedPanel = sdk.getComponent('views.settings.E2eAdvancedPanel');
diff --git a/src/createRoom.js b/src/createRoom.js
index 18fc787e1c..b5761e91c5 100644
--- a/src/createRoom.js
+++ b/src/createRoom.js
@@ -23,7 +23,6 @@ import dis from "./dispatcher/dispatcher";
import * as Rooms from "./Rooms";
import DMRoomMap from "./utils/DMRoomMap";
import {getAddressType} from "./UserAddress";
-import SettingsStore from "./settings/SettingsStore";
/**
* Create a new room, and switch to it.
@@ -226,10 +225,7 @@ export async function ensureDMExists(client, userId) {
if (existingDMRoom) {
roomId = existingDMRoom.roomId;
} else {
- let encryption;
- if (SettingsStore.getValue("feature_cross_signing")) {
- encryption = canEncryptToAllUsers(client, [userId]);
- }
+ const encryption = canEncryptToAllUsers(client, [userId]);
roomId = await createRoom({encryption, dmUserId: userId, spinner: false, andView: false});
await _waitForMember(client, roomId, userId);
}
diff --git a/src/settings/Settings.js b/src/settings/Settings.js
index e6aa112c5f..ea10a027cf 100644
--- a/src/settings/Settings.js
+++ b/src/settings/Settings.js
@@ -164,13 +164,6 @@ export const SETTINGS = {
supportedLevels: ['account'],
default: null,
},
- "feature_cross_signing": {
- // XXX: We shouldn't be using the feature prefix for non-feature settings. There is an exception
- // for this case though as we're converting a feature to a setting for a temporary safety net.
- displayName: _td("Enable cross-signing to verify per-user instead of per-session"),
- supportedLevels: ['device', 'config'], // we shouldn't use LEVELS_FEATURE for non-features, so copy it here.
- default: true,
- },
"feature_bridge_state": {
isFeature: true,
supportedLevels: LEVELS_FEATURE,
diff --git a/src/verification.js b/src/verification.js
index 289ac9544b..1dccb7dc28 100644
--- a/src/verification.js
+++ b/src/verification.js
@@ -22,12 +22,11 @@ import { _t } from './languageHandler';
import {RIGHT_PANEL_PHASES} from "./stores/RightPanelStorePhases";
import {findDMForUser} from './createRoom';
import {accessSecretStorage} from './CrossSigningManager';
-import SettingsStore from './settings/SettingsStore';
import {verificationMethods} from 'matrix-js-sdk/src/crypto';
async function enable4SIfNeeded() {
const cli = MatrixClientPeg.get();
- if (!cli.isCryptoEnabled() || !SettingsStore.getValue("feature_cross_signing")) {
+ if (!cli.isCryptoEnabled()) {
return false;
}
const usk = cli.getCrossSigningId("user_signing");
From cf50e1a40830d3c712c542d2402acb854098314e Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 27 May 2020 10:31:30 +0100
Subject: [PATCH 156/332] i18n
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/i18n/strings/en_EN.json | 88 +++++++++++++++----------------------
1 file changed, 36 insertions(+), 52 deletions(-)
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index 7474af2ee7..351ebd3be0 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -419,7 +419,6 @@
"Use the improved room list (in development - refresh to apply changes)": "Use the improved room list (in development - refresh to apply changes)",
"Support adding custom themes": "Support adding custom themes",
"Use IRC layout": "Use IRC layout",
- "Enable cross-signing to verify per-user instead of per-session": "Enable cross-signing to verify per-user instead of per-session",
"Show info about bridges in room settings": "Show info about bridges in room settings",
"Font size": "Font size",
"Custom font size": "Custom font size",
@@ -680,7 +679,6 @@
"Backup has an
invalid signature from
unverified session
": "Backup has an
invalid signature from
unverified session
",
"Backup is not signed by any of your sessions": "Backup is not signed by any of your sessions",
"This backup is trusted because it has been restored on this session": "This backup is trusted because it has been restored on this session",
- "Backup key stored in secret storage, but this feature is not enabled on this session. Please enable cross-signing in Labs to modify key backup state.": "Backup key stored in secret storage, but this feature is not enabled on this session. Please enable cross-signing in Labs to modify key backup state.",
"Backup version: ": "Backup version: ",
"Algorithm: ": "Algorithm: ",
"Backup key stored: ": "Backup key stored: ",
@@ -992,10 +990,6 @@
"Someone is using an unknown session": "Someone is using an unknown session",
"This room is end-to-end encrypted": "This room is end-to-end encrypted",
"Everyone in this room is verified": "Everyone in this room is verified",
- "Some sessions for this user are not trusted": "Some sessions for this user are not trusted",
- "All sessions for this user are trusted": "All sessions for this user are trusted",
- "Some sessions in this encrypted room are not trusted": "Some sessions in this encrypted room are not trusted",
- "All sessions in this encrypted room are trusted": "All sessions in this encrypted room are trusted",
"Edit message": "Edit message",
"Mod": "Mod",
"This event could not be displayed": "This event could not be displayed",
@@ -1016,50 +1010,6 @@
"Scroll to most recent messages": "Scroll to most recent messages",
"Close preview": "Close preview",
"device id: ": "device id: ",
- "Disinvite": "Disinvite",
- "Kick": "Kick",
- "Disinvite this user?": "Disinvite this user?",
- "Kick this user?": "Kick this user?",
- "Failed to kick": "Failed to kick",
- "Ban": "Ban",
- "Unban this user?": "Unban this user?",
- "Ban this user?": "Ban this user?",
- "Failed to ban user": "Failed to ban user",
- "No recent messages by %(user)s found": "No recent messages by %(user)s found",
- "Try scrolling up in the timeline to see if there are any earlier ones.": "Try scrolling up in the timeline to see if there are any earlier ones.",
- "Remove recent messages by %(user)s": "Remove recent messages by %(user)s",
- "You are about to remove %(count)s messages by %(user)s. This cannot be undone. Do you wish to continue?|other": "You are about to remove %(count)s messages by %(user)s. This cannot be undone. Do you wish to continue?",
- "You are about to remove %(count)s messages by %(user)s. This cannot be undone. Do you wish to continue?|one": "You are about to remove 1 message by %(user)s. This cannot be undone. Do you wish to continue?",
- "For a large amount of messages, this might take some time. Please don't refresh your client in the meantime.": "For a large amount of messages, this might take some time. Please don't refresh your client in the meantime.",
- "Remove %(count)s messages|other": "Remove %(count)s messages",
- "Remove %(count)s messages|one": "Remove 1 message",
- "Demote yourself?": "Demote yourself?",
- "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.": "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.",
- "Demote": "Demote",
- "Failed to mute user": "Failed to mute user",
- "Failed to toggle moderator status": "Failed to toggle moderator status",
- "Deactivate user?": "Deactivate user?",
- "Deactivating this user will log them out and prevent them from logging back in. Additionally, they will leave all the rooms they are in. This action cannot be reversed. Are you sure you want to deactivate this user?": "Deactivating this user will log them out and prevent them from logging back in. Additionally, they will leave all the rooms they are in. This action cannot be reversed. Are you sure you want to deactivate this user?",
- "Deactivate user": "Deactivate user",
- "Failed to deactivate user": "Failed to deactivate user",
- "Failed to change power level": "Failed to change power level",
- "You will not be able to undo this change as you are promoting the user to have the same power level as yourself.": "You will not be able to undo this change as you are promoting the user to have the same power level as yourself.",
- "Are you sure?": "Are you sure?",
- "No sessions with registered encryption keys": "No sessions with registered encryption keys",
- "Sessions": "Sessions",
- "Jump to read receipt": "Jump to read receipt",
- "Mention": "Mention",
- "Invite": "Invite",
- "Share Link to User": "Share Link to User",
- "User Options": "User Options",
- "Start a chat": "Start a chat",
- "Direct chats": "Direct chats",
- "Remove recent messages": "Remove recent messages",
- "Unmute": "Unmute",
- "Mute": "Mute",
- "Revoke Moderator": "Revoke Moderator",
- "Make Moderator": "Make Moderator",
- "Admin Tools": "Admin Tools",
"and %(count)s others...|other": "and %(count)s others...",
"and %(count)s others...|one": "and one other...",
"Invite to this room": "Invite to this room",
@@ -1074,8 +1024,6 @@
"Send a reply…": "Send a reply…",
"Send an encrypted message…": "Send an encrypted message…",
"Send a message…": "Send a message…",
- "Send a reply (unencrypted)…": "Send a reply (unencrypted)…",
- "Send a message (unencrypted)…": "Send a message (unencrypted)…",
"The conversation continues here.": "The conversation continues here.",
"This room has been replaced and is no longer active.": "This room has been replaced and is no longer active.",
"You do not have permission to post to this room": "You do not have permission to post to this room",
@@ -1204,6 +1152,7 @@
"Show Stickers": "Show Stickers",
"Failed to revoke invite": "Failed to revoke invite",
"Could not revoke the invite. The server may be experiencing a temporary problem or you do not have sufficient permissions to revoke the invite.": "Could not revoke the invite. The server may be experiencing a temporary problem or you do not have sufficient permissions to revoke the invite.",
+ "Admin Tools": "Admin Tools",
"Revoke invite": "Revoke invite",
"Invited by %(sender)s": "Invited by %(sender)s",
"Jump to first unread message.": "Jump to first unread message.",
@@ -1270,13 +1219,48 @@
"%(count)s sessions|other": "%(count)s sessions",
"%(count)s sessions|one": "%(count)s session",
"Hide sessions": "Hide sessions",
+ "Jump to read receipt": "Jump to read receipt",
+ "Mention": "Mention",
+ "Invite": "Invite",
+ "Share Link to User": "Share Link to User",
"Direct message": "Direct message",
+ "Demote yourself?": "Demote yourself?",
+ "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.": "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.",
+ "Demote": "Demote",
+ "Disinvite": "Disinvite",
+ "Kick": "Kick",
+ "Disinvite this user?": "Disinvite this user?",
+ "Kick this user?": "Kick this user?",
+ "Failed to kick": "Failed to kick",
+ "No recent messages by %(user)s found": "No recent messages by %(user)s found",
+ "Try scrolling up in the timeline to see if there are any earlier ones.": "Try scrolling up in the timeline to see if there are any earlier ones.",
+ "Remove recent messages by %(user)s": "Remove recent messages by %(user)s",
+ "You are about to remove %(count)s messages by %(user)s. This cannot be undone. Do you wish to continue?|other": "You are about to remove %(count)s messages by %(user)s. This cannot be undone. Do you wish to continue?",
+ "You are about to remove %(count)s messages by %(user)s. This cannot be undone. Do you wish to continue?|one": "You are about to remove 1 message by %(user)s. This cannot be undone. Do you wish to continue?",
+ "For a large amount of messages, this might take some time. Please don't refresh your client in the meantime.": "For a large amount of messages, this might take some time. Please don't refresh your client in the meantime.",
+ "Remove %(count)s messages|other": "Remove %(count)s messages",
+ "Remove %(count)s messages|one": "Remove 1 message",
+ "Remove recent messages": "Remove recent messages",
+ "Ban": "Ban",
+ "Unban this user?": "Unban this user?",
+ "Ban this user?": "Ban this user?",
+ "Failed to ban user": "Failed to ban user",
+ "Failed to mute user": "Failed to mute user",
+ "Unmute": "Unmute",
+ "Mute": "Mute",
"Remove from community": "Remove from community",
"Disinvite this user from community?": "Disinvite this user from community?",
"Remove this user from community?": "Remove this user from community?",
"Failed to withdraw invitation": "Failed to withdraw invitation",
"Failed to remove user from community": "Failed to remove user from community",
"
%(role)s in %(roomName)s": "
%(role)s in %(roomName)s",
+ "Failed to change power level": "Failed to change power level",
+ "You will not be able to undo this change as you are promoting the user to have the same power level as yourself.": "You will not be able to undo this change as you are promoting the user to have the same power level as yourself.",
+ "Are you sure?": "Are you sure?",
+ "Deactivate user?": "Deactivate user?",
+ "Deactivating this user will log them out and prevent them from logging back in. Additionally, they will leave all the rooms they are in. This action cannot be reversed. Are you sure you want to deactivate this user?": "Deactivating this user will log them out and prevent them from logging back in. Additionally, they will leave all the rooms they are in. This action cannot be reversed. Are you sure you want to deactivate this user?",
+ "Deactivate user": "Deactivate user",
+ "Failed to deactivate user": "Failed to deactivate user",
"This client does not support end-to-end encryption.": "This client does not support end-to-end encryption.",
"Security": "Security",
"The session you are trying to verify doesn't support scanning a QR code or emoji verification, which is what Riot supports. Try with a different client.": "The session you are trying to verify doesn't support scanning a QR code or emoji verification, which is what Riot supports. Try with a different client.",
From cc68f53fc2854bd52df22bdc6bef91668c2c9828 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 27 May 2020 10:47:01 +0100
Subject: [PATCH 157/332] tidy up and delint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/components/structures/MatrixChat.tsx | 3 ---
src/components/structures/RightPanel.js | 19 +++++--------------
.../views/dialogs/DeviceVerifyDialog.js | 8 ++------
src/components/views/dialogs/InviteDialog.js | 1 -
.../keybackup/RestoreKeyBackupDialog.js | 2 --
.../views/settings/KeyBackupPanel.js | 1 -
.../tabs/user/SecurityUserSettingsTab.js | 2 +-
7 files changed, 8 insertions(+), 28 deletions(-)
diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx
index 2bebdd1e79..125828689d 100644
--- a/src/components/structures/MatrixChat.tsx
+++ b/src/components/structures/MatrixChat.tsx
@@ -1937,9 +1937,6 @@ export default class MatrixChat extends React.PureComponent
{
}
if (await cli.doesServerSupportUnstableFeature("org.matrix.e2e_cross_signing")) {
- // This will only work if the feature is set to 'enable' in the config,
- // since it's too early in the lifecycle for users to have turned the
- // labs flag on.
this.setStateForNewView({ view: Views.E2E_SETUP });
} else {
this.onLoggedIn();
diff --git a/src/components/structures/RightPanel.js b/src/components/structures/RightPanel.js
index 811feb8614..776130e709 100644
--- a/src/components/structures/RightPanel.js
+++ b/src/components/structures/RightPanel.js
@@ -26,7 +26,6 @@ import dis from '../../dispatcher/dispatcher';
import RateLimitedFunc from '../../ratelimitedfunc';
import { showGroupInviteDialog, showGroupAddRoomDialog } from '../../GroupAddressPicker';
import GroupStore from '../../stores/GroupStore';
-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";
@@ -189,7 +188,7 @@ export default class RightPanel extends React.Component {
}
}
- onCloseRoomMemberInfo = () => {
+ onCloseUserInfo = () => {
// XXX: There are three different ways of 'closing' this panel depending on what state
// things are in... this knows far more than it should do about the state of the rest
// of the app and is generally a bit silly.
@@ -203,23 +202,15 @@ export default class RightPanel extends React.Component {
});
} else {
// Otherwise we have got our user from RoomViewStore which means we're being shown
- // within a room, so go back to the member panel if we were in the encryption panel,
+ // within a room/group, 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: Action.ViewUser,
- member: this.state.phase === RIGHT_PANEL_PHASES.EncryptionPanel ?
- this.state.member : null,
+ member: this.state.phase === RIGHT_PANEL_PHASES.EncryptionPanel ? this.state.member : null,
});
}
};
- onCloseGroupMemberInfo = () => {
- dis.dispatch({
- action: Action.ViewUser,
- member: null,
- });
- };
-
render() {
const MemberList = sdk.getComponent('rooms.MemberList');
const UserInfo = sdk.getComponent('right_panel.UserInfo');
@@ -253,7 +244,7 @@ export default class RightPanel extends React.Component {
user={this.state.member}
roomId={this.props.roomId}
key={this.props.roomId || this.state.member.userId}
- onClose={this.onCloseRoomMemberInfo}
+ onClose={this.onCloseUserInfo}
phase={this.state.phase}
verificationRequest={this.state.verificationRequest}
verificationRequestPromise={this.state.verificationRequestPromise}
@@ -267,7 +258,7 @@ export default class RightPanel extends React.Component {
user={this.state.member}
groupId={this.props.groupId}
key={this.state.member.userId}
- onClose={this.onCloseGroupMemberInfo} />;
+ onClose={this.onCloseUserInfo} />;
break;
case RIGHT_PANEL_PHASES.GroupRoomInfo:
panel = r.ready || r.started);
this.setState({phase: PHASE_PICK_VERIFICATION_OPTION});
- } else {
- this._verifier = client.beginKeyVerification(
- verificationMethods.SAS, this.props.userId, this.props.device.deviceId,
- );
}
+
if (!this._verifier) return;
this._verifier.on('show_sas', this._onVerifierShowSas);
// throws upon cancellation
diff --git a/src/components/views/dialogs/InviteDialog.js b/src/components/views/dialogs/InviteDialog.js
index 79eb1b5b9d..c245ba35aa 100644
--- a/src/components/views/dialogs/InviteDialog.js
+++ b/src/components/views/dialogs/InviteDialog.js
@@ -33,7 +33,6 @@ import Modal from "../../../Modal";
import {humanizeTime} from "../../../utils/humanize";
import createRoom, {canEncryptToAllUsers} from "../../../createRoom";
import {inviteMultipleToRoom} from "../../../RoomInvite";
-import SettingsStore from '../../../settings/SettingsStore';
import {Key} from "../../../Keyboard";
import {Action} from "../../../dispatcher/actions";
import {RoomListStoreTempProxy} from "../../../stores/room-list/RoomListStoreTempProxy";
diff --git a/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js b/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js
index 4944c4b5ee..a27853db56 100644
--- a/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js
+++ b/src/components/views/dialogs/keybackup/RestoreKeyBackupDialog.js
@@ -20,10 +20,8 @@ import PropTypes from 'prop-types';
import * as sdk from '../../../../index';
import {MatrixClientPeg} from '../../../../MatrixClientPeg';
import { MatrixClient } from 'matrix-js-sdk';
-import Modal from '../../../../Modal';
import { _t } from '../../../../languageHandler';
import { accessSecretStorage } from '../../../../CrossSigningManager';
-import SettingsStore from "../../../../settings/SettingsStore";
const RESTORE_TYPE_PASSPHRASE = 0;
const RESTORE_TYPE_RECOVERYKEY = 1;
diff --git a/src/components/views/settings/KeyBackupPanel.js b/src/components/views/settings/KeyBackupPanel.js
index d09870d5e3..a7a2c768db 100644
--- a/src/components/views/settings/KeyBackupPanel.js
+++ b/src/components/views/settings/KeyBackupPanel.js
@@ -21,7 +21,6 @@ import * as sdk from '../../../index';
import {MatrixClientPeg} from '../../../MatrixClientPeg';
import { _t } from '../../../languageHandler';
import Modal from '../../../Modal';
-import SettingsStore from '../../../settings/SettingsStore';
export default class KeyBackupPanel extends React.PureComponent {
constructor(props) {
diff --git a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js
index a410617631..b3c3f63d72 100644
--- a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js
+++ b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js
@@ -17,7 +17,7 @@ limitations under the License.
import React from 'react';
import PropTypes from 'prop-types';
import {_t} from "../../../../../languageHandler";
-import SettingsStore, {SettingLevel} from "../../../../../settings/SettingsStore";
+import {SettingLevel} from "../../../../../settings/SettingsStore";
import {MatrixClientPeg} from "../../../../../MatrixClientPeg";
import * as FormattingUtils from "../../../../../utils/FormattingUtils";
import AccessibleButton from "../../../elements/AccessibleButton";
From 254ed4b1b60c1bf8964a67febf2761a22773802b Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 27 May 2020 11:33:42 +0100
Subject: [PATCH 158/332] Add debug lined to figure out e2e test failure
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/stores/ToastStore.ts | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/stores/ToastStore.ts b/src/stores/ToastStore.ts
index e963ecd736..a26c5e0794 100644
--- a/src/stores/ToastStore.ts
+++ b/src/stores/ToastStore.ts
@@ -56,6 +56,7 @@ export default class ToastStore extends EventEmitter {
* @param {object} newToast The new toast
*/
addOrReplaceToast>(newToast: IToast) {
+ console.log("DEBUG addOrReplaceToast", newToast.key, JSON.stringify(newToast));
const oldIndex = this.toasts.findIndex(t => t.key === newToast.key);
if (oldIndex === -1) {
let newIndex = this.toasts.length;
@@ -68,6 +69,7 @@ export default class ToastStore extends EventEmitter {
}
dismissToast(key) {
+ console.log("DEBUG dismissToast", key);
const length = this.toasts.length;
this.toasts = this.toasts.filter(t => t.key !== key);
if (length !== this.toasts.length) {
From 3dade4e759bc4d01af126e1f3a5d64c4057b1d20 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 27 May 2020 11:48:48 +0100
Subject: [PATCH 159/332] tweak
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/stores/ToastStore.ts | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/stores/ToastStore.ts b/src/stores/ToastStore.ts
index a26c5e0794..2f5a1f74b0 100644
--- a/src/stores/ToastStore.ts
+++ b/src/stores/ToastStore.ts
@@ -70,13 +70,15 @@ export default class ToastStore extends EventEmitter {
dismissToast(key) {
console.log("DEBUG dismissToast", key);
+ if (this.toasts[0] && this.toasts[0].key === key) {
+ this.countSeen++;
+ }
+
const length = this.toasts.length;
this.toasts = this.toasts.filter(t => t.key !== key);
if (length !== this.toasts.length) {
if (this.toasts.length === 0) {
this.countSeen = 0;
- } else {
- this.countSeen++;
}
this.emit('update');
From efa47f1a8e948e2920aa640cccfad94caa9942b5 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 27 May 2020 12:02:51 +0100
Subject: [PATCH 160/332] Change out debug
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/components/structures/MatrixChat.tsx | 1 +
src/stores/ToastStore.ts | 2 --
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx
index f2d7e81d85..f8c96ee393 100644
--- a/src/components/structures/MatrixChat.tsx
+++ b/src/components/structures/MatrixChat.tsx
@@ -624,6 +624,7 @@ export default class MatrixChat extends React.PureComponent {
break;
}
case 'view_room_directory': {
+ console.log("DEBUG view_room_directory");
const RoomDirectory = sdk.getComponent("structures.RoomDirectory");
Modal.createTrackedDialog('Room directory', '', RoomDirectory, {},
'mx_RoomDirectory_dialogWrapper', false, true);
diff --git a/src/stores/ToastStore.ts b/src/stores/ToastStore.ts
index 2f5a1f74b0..55c48c3937 100644
--- a/src/stores/ToastStore.ts
+++ b/src/stores/ToastStore.ts
@@ -56,7 +56,6 @@ export default class ToastStore extends EventEmitter {
* @param {object} newToast The new toast
*/
addOrReplaceToast>(newToast: IToast) {
- console.log("DEBUG addOrReplaceToast", newToast.key, JSON.stringify(newToast));
const oldIndex = this.toasts.findIndex(t => t.key === newToast.key);
if (oldIndex === -1) {
let newIndex = this.toasts.length;
@@ -69,7 +68,6 @@ export default class ToastStore extends EventEmitter {
}
dismissToast(key) {
- console.log("DEBUG dismissToast", key);
if (this.toasts[0] && this.toasts[0].key === key) {
this.countSeen++;
}
From 48de17457663867359b511344210d5d962200d29 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 27 May 2020 12:20:20 +0100
Subject: [PATCH 161/332] remove debug
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/components/structures/MatrixChat.tsx | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx
index f8c96ee393..f2d7e81d85 100644
--- a/src/components/structures/MatrixChat.tsx
+++ b/src/components/structures/MatrixChat.tsx
@@ -624,7 +624,6 @@ export default class MatrixChat extends React.PureComponent {
break;
}
case 'view_room_directory': {
- console.log("DEBUG view_room_directory");
const RoomDirectory = sdk.getComponent("structures.RoomDirectory");
Modal.createTrackedDialog('Room directory', '', RoomDirectory, {},
'mx_RoomDirectory_dialogWrapper', false, true);
From b7c688d3282d5156c74f9ac50e0780908c895965 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 27 May 2020 12:40:38 +0100
Subject: [PATCH 162/332] test e2e tests workaround
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
test/end-to-end-tests/src/usecases/join.js | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/test/end-to-end-tests/src/usecases/join.js b/test/end-to-end-tests/src/usecases/join.js
index 655c0be686..10a48bd71c 100644
--- a/test/end-to-end-tests/src/usecases/join.js
+++ b/test/end-to-end-tests/src/usecases/join.js
@@ -19,6 +19,15 @@ const {openRoomDirectory} = require('./create-room');
module.exports = async function join(session, roomName) {
session.log.step(`joins room "${roomName}"`);
+ while (true) {
+ try {
+ const toastDismissButton = await session.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger');
+ await toastDismissButton.click();
+ } catch (e) {
+ break;
+ }
+ }
+
await openRoomDirectory(session);
const roomInput = await session.query('.mx_DirectorySearchBox input');
await session.replaceInputText(roomInput, roomName);
From 7b6d49c416f63576fcdf3be088b80cc2b87bde71 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 27 May 2020 12:57:45 +0100
Subject: [PATCH 163/332] e2e test toasts
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
test/end-to-end-tests/src/scenario.js | 2 +
test/end-to-end-tests/src/scenarios/toast.js | 23 ++++++++++
test/end-to-end-tests/src/usecases/join.js | 9 ----
test/end-to-end-tests/src/usecases/toasts.js | 45 ++++++++++++++++++++
4 files changed, 70 insertions(+), 9 deletions(-)
create mode 100644 test/end-to-end-tests/src/scenarios/toast.js
create mode 100644 test/end-to-end-tests/src/usecases/toasts.js
diff --git a/test/end-to-end-tests/src/scenario.js b/test/end-to-end-tests/src/scenario.js
index f575fb392e..2191d630ac 100644
--- a/test/end-to-end-tests/src/scenario.js
+++ b/test/end-to-end-tests/src/scenario.js
@@ -17,6 +17,7 @@ limitations under the License.
const {range} = require('./util');
const signup = require('./usecases/signup');
+const toastScenarios = require('./scenarios/toast');
const roomDirectoryScenarios = require('./scenarios/directory');
const lazyLoadingScenarios = require('./scenarios/lazy-loading');
const e2eEncryptionScenarios = require('./scenarios/e2e-encryption');
@@ -37,6 +38,7 @@ module.exports = async function scenario(createSession, restCreator) {
const alice = await createUser("alice");
const bob = await createUser("bob");
+ await toastScenarios(alice, bob);
await roomDirectoryScenarios(alice, bob);
await e2eEncryptionScenarios(alice, bob);
console.log("create REST users:");
diff --git a/test/end-to-end-tests/src/scenarios/toast.js b/test/end-to-end-tests/src/scenarios/toast.js
new file mode 100644
index 0000000000..91c6ed750f
--- /dev/null
+++ b/test/end-to-end-tests/src/scenarios/toast.js
@@ -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.
+*/
+
+const {acceptToast} = require("../usecases/toasts");
+
+module.exports = async function toastScenarios(alice, bob) {
+ console.log(" checking and clearing all toasts:");
+ await acceptToast(alice, "Help us improve Riot");
+ await acceptToast(bob, "Help us improve Riot");
+};
diff --git a/test/end-to-end-tests/src/usecases/join.js b/test/end-to-end-tests/src/usecases/join.js
index 10a48bd71c..655c0be686 100644
--- a/test/end-to-end-tests/src/usecases/join.js
+++ b/test/end-to-end-tests/src/usecases/join.js
@@ -19,15 +19,6 @@ const {openRoomDirectory} = require('./create-room');
module.exports = async function join(session, roomName) {
session.log.step(`joins room "${roomName}"`);
- while (true) {
- try {
- const toastDismissButton = await session.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger');
- await toastDismissButton.click();
- } catch (e) {
- break;
- }
- }
-
await openRoomDirectory(session);
const roomInput = await session.query('.mx_DirectorySearchBox input');
await session.replaceInputText(roomInput, roomName);
diff --git a/test/end-to-end-tests/src/usecases/toasts.js b/test/end-to-end-tests/src/usecases/toasts.js
new file mode 100644
index 0000000000..663484ce6e
--- /dev/null
+++ b/test/end-to-end-tests/src/usecases/toasts.js
@@ -0,0 +1,45 @@
+/*
+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.
+*/
+
+const assert = require('assert');
+
+async function assertToast(session, expectedTitle) {
+ const h2Element = await session.query('.mx_Toast_title h2');
+ const toastTitle = await session.innerText(h2Element);
+ assert(toastTitle, expectedTitle);
+}
+
+async function acceptToast(session, expectedTitle) {
+ const foundToast = await assertToast(session, expectedTitle);
+ if (!foundToast) {
+ throw new Error("could not find expected toast");
+ }
+
+ const btn = await session.query('.mx_Toast_buttons .mx_AccessibleButton_kind_primary');
+ await btn.click();
+}
+
+async function rejectToast(session, expectedTitle) {
+ const foundToast = await assertToast(session, expectedTitle);
+ if (!foundToast) {
+ throw new Error("could not find expected toast");
+ }
+
+ const btn = await session.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger');
+ await btn.click();
+}
+
+module.exports = {assertToast, acceptToast, rejectToast};
From d9552c7f5c4296ee92258614c261cb3d01352d4f Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 27 May 2020 13:10:28 +0100
Subject: [PATCH 164/332] e2e test toasts v2
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
test/end-to-end-tests/src/scenarios/toast.js | 12 ++++++++++--
test/end-to-end-tests/src/usecases/toasts.js | 12 ++----------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/test/end-to-end-tests/src/scenarios/toast.js b/test/end-to-end-tests/src/scenarios/toast.js
index 91c6ed750f..9a0594cc31 100644
--- a/test/end-to-end-tests/src/scenarios/toast.js
+++ b/test/end-to-end-tests/src/scenarios/toast.js
@@ -14,10 +14,18 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-const {acceptToast} = require("../usecases/toasts");
+const {acceptToast, rejectToast} = require("../usecases/toasts");
module.exports = async function toastScenarios(alice, bob) {
console.log(" checking and clearing all toasts:");
+
+ alice.log.startGroup(`clears toasts`);
+ await acceptToast(alice, "Notifications");
await acceptToast(alice, "Help us improve Riot");
- await acceptToast(bob, "Help us improve Riot");
+ alice.log.endGroup();
+
+ bob.log.startGroup(`clears toasts`);
+ await rejectToast(bob, "Notifications");
+ await rejectToast(bob, "Help us improve Riot");
+ bob.log.endGroup();
};
diff --git a/test/end-to-end-tests/src/usecases/toasts.js b/test/end-to-end-tests/src/usecases/toasts.js
index 663484ce6e..991d3cc39c 100644
--- a/test/end-to-end-tests/src/usecases/toasts.js
+++ b/test/end-to-end-tests/src/usecases/toasts.js
@@ -23,21 +23,13 @@ async function assertToast(session, expectedTitle) {
}
async function acceptToast(session, expectedTitle) {
- const foundToast = await assertToast(session, expectedTitle);
- if (!foundToast) {
- throw new Error("could not find expected toast");
- }
-
+ await assertToast(session, expectedTitle);
const btn = await session.query('.mx_Toast_buttons .mx_AccessibleButton_kind_primary');
await btn.click();
}
async function rejectToast(session, expectedTitle) {
- const foundToast = await assertToast(session, expectedTitle);
- if (!foundToast) {
- throw new Error("could not find expected toast");
- }
-
+ await assertToast(session, expectedTitle);
const btn = await session.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger');
await btn.click();
}
From 37c875b8635107eb966a692141deed915d14669e Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 27 May 2020 13:23:49 +0100
Subject: [PATCH 165/332] improve end to end tests
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
test/end-to-end-tests/src/scenarios/toast.js | 10 ++++++++--
test/end-to-end-tests/src/usecases/toasts.js | 7 ++++++-
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/test/end-to-end-tests/src/scenarios/toast.js b/test/end-to-end-tests/src/scenarios/toast.js
index 9a0594cc31..b5b7fa4494 100644
--- a/test/end-to-end-tests/src/scenarios/toast.js
+++ b/test/end-to-end-tests/src/scenarios/toast.js
@@ -14,18 +14,24 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-const {acceptToast, rejectToast} = require("../usecases/toasts");
+const {assertNoToasts, acceptToast, rejectToast} = require("../usecases/toasts");
module.exports = async function toastScenarios(alice, bob) {
- console.log(" checking and clearing all toasts:");
+ console.log(" checking and clearing toasts:");
alice.log.startGroup(`clears toasts`);
+ alice.log.step(`accepts desktop notifications toast`);
await acceptToast(alice, "Notifications");
+ alice.log.step(`accepts analytics toast`);
await acceptToast(alice, "Help us improve Riot");
+ await assertNoToasts(alice);
alice.log.endGroup();
bob.log.startGroup(`clears toasts`);
+ alice.log.step(`reject desktop notifications toast`);
await rejectToast(bob, "Notifications");
+ alice.log.step(`reject analytics toast`);
await rejectToast(bob, "Help us improve Riot");
+ await assertNoToasts(bob);
bob.log.endGroup();
};
diff --git a/test/end-to-end-tests/src/usecases/toasts.js b/test/end-to-end-tests/src/usecases/toasts.js
index 991d3cc39c..636714d66b 100644
--- a/test/end-to-end-tests/src/usecases/toasts.js
+++ b/test/end-to-end-tests/src/usecases/toasts.js
@@ -16,6 +16,11 @@ limitations under the License.
const assert = require('assert');
+async function assertNoToasts(session) {
+ const toast = await session.query('.mx_Toast_toast');
+ assert(!toast, 'toast found when none expected');
+}
+
async function assertToast(session, expectedTitle) {
const h2Element = await session.query('.mx_Toast_title h2');
const toastTitle = await session.innerText(h2Element);
@@ -34,4 +39,4 @@ async function rejectToast(session, expectedTitle) {
await btn.click();
}
-module.exports = {assertToast, acceptToast, rejectToast};
+module.exports = {assertNoToasts, assertToast, acceptToast, rejectToast};
From faaca43a75f5281ceb335ef1e9514836c0d8c396 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 27 May 2020 13:35:15 +0100
Subject: [PATCH 166/332] more loggin'
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
test/end-to-end-tests/src/scenarios/toast.js | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/test/end-to-end-tests/src/scenarios/toast.js b/test/end-to-end-tests/src/scenarios/toast.js
index b5b7fa4494..ee3f2954f3 100644
--- a/test/end-to-end-tests/src/scenarios/toast.js
+++ b/test/end-to-end-tests/src/scenarios/toast.js
@@ -20,18 +20,32 @@ module.exports = async function toastScenarios(alice, bob) {
console.log(" checking and clearing toasts:");
alice.log.startGroup(`clears toasts`);
+
alice.log.step(`accepts desktop notifications toast`);
await acceptToast(alice, "Notifications");
+ alice.log.done();
+
alice.log.step(`accepts analytics toast`);
await acceptToast(alice, "Help us improve Riot");
+ alice.log.done();
+
+ alice.log.step(`checks no remaining toasts`);
await assertNoToasts(alice);
+ alice.log.done();
alice.log.endGroup();
bob.log.startGroup(`clears toasts`);
- alice.log.step(`reject desktop notifications toast`);
+
+ bob.log.step(`reject desktop notifications toast`);
await rejectToast(bob, "Notifications");
- alice.log.step(`reject analytics toast`);
+ bob.log.done();
+
+ bob.log.step(`reject analytics toast`);
await rejectToast(bob, "Help us improve Riot");
+ bob.log.done();
+
+ bob.log.step(`checks no remaining toasts`);
await assertNoToasts(bob);
+ bob.log.done();
bob.log.endGroup();
};
From 841ce74ac2fde0201b1b698a0b096fd5f5158467 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 27 May 2020 13:39:00 +0100
Subject: [PATCH 167/332] Fix assert vs assert.equal
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
test/end-to-end-tests/src/usecases/dialog.js | 2 +-
test/end-to-end-tests/src/usecases/toasts.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/end-to-end-tests/src/usecases/dialog.js b/test/end-to-end-tests/src/usecases/dialog.js
index d4ae97dff9..15ac50bb18 100644
--- a/test/end-to-end-tests/src/usecases/dialog.js
+++ b/test/end-to-end-tests/src/usecases/dialog.js
@@ -20,7 +20,7 @@ const assert = require('assert');
async function assertDialog(session, expectedTitle) {
const titleElement = await session.query(".mx_Dialog .mx_Dialog_title");
const dialogHeader = await session.innerText(titleElement);
- assert(dialogHeader, expectedTitle);
+ assert.equal(dialogHeader, expectedTitle);
}
async function acceptDialog(session, expectedTitle) {
diff --git a/test/end-to-end-tests/src/usecases/toasts.js b/test/end-to-end-tests/src/usecases/toasts.js
index 636714d66b..a82c910eea 100644
--- a/test/end-to-end-tests/src/usecases/toasts.js
+++ b/test/end-to-end-tests/src/usecases/toasts.js
@@ -24,7 +24,7 @@ async function assertNoToasts(session) {
async function assertToast(session, expectedTitle) {
const h2Element = await session.query('.mx_Toast_title h2');
const toastTitle = await session.innerText(h2Element);
- assert(toastTitle, expectedTitle);
+ assert.equal(toastTitle, expectedTitle);
}
async function acceptToast(session, expectedTitle) {
From 627b5685887d02ed31f8c1fbecc45f48d8edbbbe Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 27 May 2020 13:48:20 +0100
Subject: [PATCH 168/332] check if it is a race
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
test/end-to-end-tests/src/scenarios/toast.js | 2 ++
1 file changed, 2 insertions(+)
diff --git a/test/end-to-end-tests/src/scenarios/toast.js b/test/end-to-end-tests/src/scenarios/toast.js
index ee3f2954f3..980ee4b33f 100644
--- a/test/end-to-end-tests/src/scenarios/toast.js
+++ b/test/end-to-end-tests/src/scenarios/toast.js
@@ -29,6 +29,7 @@ module.exports = async function toastScenarios(alice, bob) {
await acceptToast(alice, "Help us improve Riot");
alice.log.done();
+ await alice.delay(300);
alice.log.step(`checks no remaining toasts`);
await assertNoToasts(alice);
alice.log.done();
@@ -44,6 +45,7 @@ module.exports = async function toastScenarios(alice, bob) {
await rejectToast(bob, "Help us improve Riot");
bob.log.done();
+ await bob.delay(300);
bob.log.step(`checks no remaining toasts`);
await assertNoToasts(bob);
bob.log.done();
From 61066b0c4c915285f2bb0e5bf8c123cadbcab1f6 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 27 May 2020 14:27:09 +0100
Subject: [PATCH 169/332] test it again
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
test/end-to-end-tests/src/scenarios/toast.js | 22 ++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/test/end-to-end-tests/src/scenarios/toast.js b/test/end-to-end-tests/src/scenarios/toast.js
index 980ee4b33f..34b979f09a 100644
--- a/test/end-to-end-tests/src/scenarios/toast.js
+++ b/test/end-to-end-tests/src/scenarios/toast.js
@@ -20,7 +20,6 @@ module.exports = async function toastScenarios(alice, bob) {
console.log(" checking and clearing toasts:");
alice.log.startGroup(`clears toasts`);
-
alice.log.step(`accepts desktop notifications toast`);
await acceptToast(alice, "Notifications");
alice.log.done();
@@ -29,14 +28,21 @@ module.exports = async function toastScenarios(alice, bob) {
await acceptToast(alice, "Help us improve Riot");
alice.log.done();
- await alice.delay(300);
+ while (true) {
+ try {
+ const toastDismissButton = await alice.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger');
+ await toastDismissButton.click();
+ } catch (e) {
+ break;
+ }
+ }
+
alice.log.step(`checks no remaining toasts`);
await assertNoToasts(alice);
alice.log.done();
alice.log.endGroup();
bob.log.startGroup(`clears toasts`);
-
bob.log.step(`reject desktop notifications toast`);
await rejectToast(bob, "Notifications");
bob.log.done();
@@ -45,7 +51,15 @@ module.exports = async function toastScenarios(alice, bob) {
await rejectToast(bob, "Help us improve Riot");
bob.log.done();
- await bob.delay(300);
+ while (true) {
+ try {
+ const toastDismissButton = await bob.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger');
+ await toastDismissButton.click();
+ } catch (e) {
+ break;
+ }
+ }
+
bob.log.step(`checks no remaining toasts`);
await assertNoToasts(bob);
bob.log.done();
From 91811581bc9412d48842a7341c8f3c33a5623170 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 27 May 2020 14:35:59 +0100
Subject: [PATCH 170/332] fix assertNoToasts
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
test/end-to-end-tests/src/usecases/toasts.js | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/test/end-to-end-tests/src/usecases/toasts.js b/test/end-to-end-tests/src/usecases/toasts.js
index a82c910eea..2e88677e4b 100644
--- a/test/end-to-end-tests/src/usecases/toasts.js
+++ b/test/end-to-end-tests/src/usecases/toasts.js
@@ -17,8 +17,12 @@ limitations under the License.
const assert = require('assert');
async function assertNoToasts(session) {
- const toast = await session.query('.mx_Toast_toast');
- assert(!toast, 'toast found when none expected');
+ try {
+ await session.query('.mx_Toast_toast');
+ } catch (e) {
+ return;
+ }
+ throw new Error('toast found when none expected');
}
async function assertToast(session, expectedTitle) {
From f3dfdbe74644f974b855a8d494ecbc4d205fd93b Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 27 May 2020 14:36:44 +0100
Subject: [PATCH 171/332] debug
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
test/end-to-end-tests/src/scenarios/toast.js | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/test/end-to-end-tests/src/scenarios/toast.js b/test/end-to-end-tests/src/scenarios/toast.js
index 34b979f09a..f528e993c3 100644
--- a/test/end-to-end-tests/src/scenarios/toast.js
+++ b/test/end-to-end-tests/src/scenarios/toast.js
@@ -30,6 +30,9 @@ module.exports = async function toastScenarios(alice, bob) {
while (true) {
try {
+ const h2Element = await alice.query('.mx_Toast_title h2');
+ const toastTitle = await alice.innerText(h2Element);
+ console.log("DEBUG closing", toastTitle);
const toastDismissButton = await alice.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger');
await toastDismissButton.click();
} catch (e) {
@@ -53,6 +56,9 @@ module.exports = async function toastScenarios(alice, bob) {
while (true) {
try {
+ const h2Element = await bob.query('.mx_Toast_title h2');
+ const toastTitle = await bob.innerText(h2Element);
+ console.log("DEBUG closing", toastTitle);
const toastDismissButton = await bob.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger');
await toastDismissButton.click();
} catch (e) {
From 63ac1cb4ab583de0eb2869be09f6fc76877f0f37 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 27 May 2020 14:56:24 +0100
Subject: [PATCH 172/332] debug some more
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
test/end-to-end-tests/src/scenarios/toast.js | 28 ++++++++++----------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/test/end-to-end-tests/src/scenarios/toast.js b/test/end-to-end-tests/src/scenarios/toast.js
index f528e993c3..97b5caa14f 100644
--- a/test/end-to-end-tests/src/scenarios/toast.js
+++ b/test/end-to-end-tests/src/scenarios/toast.js
@@ -20,13 +20,13 @@ module.exports = async function toastScenarios(alice, bob) {
console.log(" checking and clearing toasts:");
alice.log.startGroup(`clears toasts`);
- alice.log.step(`accepts desktop notifications toast`);
- await acceptToast(alice, "Notifications");
- alice.log.done();
-
- alice.log.step(`accepts analytics toast`);
- await acceptToast(alice, "Help us improve Riot");
- alice.log.done();
+ // alice.log.step(`accepts desktop notifications toast`);
+ // await acceptToast(alice, "Notifications");
+ // alice.log.done();
+ //
+ // alice.log.step(`accepts analytics toast`);
+ // await acceptToast(alice, "Help us improve Riot");
+ // alice.log.done();
while (true) {
try {
@@ -46,13 +46,13 @@ module.exports = async function toastScenarios(alice, bob) {
alice.log.endGroup();
bob.log.startGroup(`clears toasts`);
- bob.log.step(`reject desktop notifications toast`);
- await rejectToast(bob, "Notifications");
- bob.log.done();
-
- bob.log.step(`reject analytics toast`);
- await rejectToast(bob, "Help us improve Riot");
- bob.log.done();
+ // bob.log.step(`reject desktop notifications toast`);
+ // await rejectToast(bob, "Notifications");
+ // bob.log.done();
+ //
+ // bob.log.step(`reject analytics toast`);
+ // await rejectToast(bob, "Help us improve Riot");
+ // bob.log.done();
while (true) {
try {
From cb07fa53f4282ebfe8f12d63f93bba8344f62b9e Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 27 May 2020 15:05:40 +0100
Subject: [PATCH 173/332] test
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
test/end-to-end-tests/src/scenarios/toast.js | 48 +++++---------------
1 file changed, 12 insertions(+), 36 deletions(-)
diff --git a/test/end-to-end-tests/src/scenarios/toast.js b/test/end-to-end-tests/src/scenarios/toast.js
index 97b5caa14f..02496f398d 100644
--- a/test/end-to-end-tests/src/scenarios/toast.js
+++ b/test/end-to-end-tests/src/scenarios/toast.js
@@ -20,25 +20,13 @@ module.exports = async function toastScenarios(alice, bob) {
console.log(" checking and clearing toasts:");
alice.log.startGroup(`clears toasts`);
- // alice.log.step(`accepts desktop notifications toast`);
- // await acceptToast(alice, "Notifications");
- // alice.log.done();
- //
- // alice.log.step(`accepts analytics toast`);
- // await acceptToast(alice, "Help us improve Riot");
- // alice.log.done();
+ alice.log.step(`accepts desktop notifications toast`);
+ await acceptToast(alice, "Notifications");
+ alice.log.done();
- while (true) {
- try {
- const h2Element = await alice.query('.mx_Toast_title h2');
- const toastTitle = await alice.innerText(h2Element);
- console.log("DEBUG closing", toastTitle);
- const toastDismissButton = await alice.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger');
- await toastDismissButton.click();
- } catch (e) {
- break;
- }
- }
+ alice.log.step(`rejects analytics toast`);
+ await rejectToast(alice, "Help us improve Riot");
+ alice.log.done();
alice.log.step(`checks no remaining toasts`);
await assertNoToasts(alice);
@@ -46,25 +34,13 @@ module.exports = async function toastScenarios(alice, bob) {
alice.log.endGroup();
bob.log.startGroup(`clears toasts`);
- // bob.log.step(`reject desktop notifications toast`);
- // await rejectToast(bob, "Notifications");
- // bob.log.done();
- //
- // bob.log.step(`reject analytics toast`);
- // await rejectToast(bob, "Help us improve Riot");
- // bob.log.done();
+ bob.log.step(`reject desktop notifications toast`);
+ await rejectToast(bob, "Notifications");
+ bob.log.done();
- while (true) {
- try {
- const h2Element = await bob.query('.mx_Toast_title h2');
- const toastTitle = await bob.innerText(h2Element);
- console.log("DEBUG closing", toastTitle);
- const toastDismissButton = await bob.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger');
- await toastDismissButton.click();
- } catch (e) {
- break;
- }
- }
+ bob.log.step(`reject analytics toast`);
+ await rejectToast(bob, "Help us improve Riot");
+ bob.log.done();
bob.log.step(`checks no remaining toasts`);
await assertNoToasts(bob);
From e35c9d5bbf5eec8e55a6485b275559ef39d7625f Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 27 May 2020 15:18:43 +0100
Subject: [PATCH 174/332] more testing
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/toasts/AnalyticsToast.tsx | 2 +
test/end-to-end-tests/src/scenarios/toast.js | 48 +++++++++++++++-----
test/end-to-end-tests/src/usecases/toasts.js | 5 +-
3 files changed, 42 insertions(+), 13 deletions(-)
diff --git a/src/toasts/AnalyticsToast.tsx b/src/toasts/AnalyticsToast.tsx
index b186a65d9d..7cd59222dd 100644
--- a/src/toasts/AnalyticsToast.tsx
+++ b/src/toasts/AnalyticsToast.tsx
@@ -24,12 +24,14 @@ import GenericToast from "../components/views/toasts/GenericToast";
import ToastStore from "../stores/ToastStore";
const onAccept = () => {
+ console.log("DEBUG onAccept AnalyticsToast");
dis.dispatch({
action: 'accept_cookies',
});
};
const onReject = () => {
+ console.log("DEBUG onReject AnalyticsToast");
dis.dispatch({
action: "reject_cookies",
});
diff --git a/test/end-to-end-tests/src/scenarios/toast.js b/test/end-to-end-tests/src/scenarios/toast.js
index 02496f398d..97b5caa14f 100644
--- a/test/end-to-end-tests/src/scenarios/toast.js
+++ b/test/end-to-end-tests/src/scenarios/toast.js
@@ -20,13 +20,25 @@ module.exports = async function toastScenarios(alice, bob) {
console.log(" checking and clearing toasts:");
alice.log.startGroup(`clears toasts`);
- alice.log.step(`accepts desktop notifications toast`);
- await acceptToast(alice, "Notifications");
- alice.log.done();
+ // alice.log.step(`accepts desktop notifications toast`);
+ // await acceptToast(alice, "Notifications");
+ // alice.log.done();
+ //
+ // alice.log.step(`accepts analytics toast`);
+ // await acceptToast(alice, "Help us improve Riot");
+ // alice.log.done();
- alice.log.step(`rejects analytics toast`);
- await rejectToast(alice, "Help us improve Riot");
- alice.log.done();
+ while (true) {
+ try {
+ const h2Element = await alice.query('.mx_Toast_title h2');
+ const toastTitle = await alice.innerText(h2Element);
+ console.log("DEBUG closing", toastTitle);
+ const toastDismissButton = await alice.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger');
+ await toastDismissButton.click();
+ } catch (e) {
+ break;
+ }
+ }
alice.log.step(`checks no remaining toasts`);
await assertNoToasts(alice);
@@ -34,13 +46,25 @@ module.exports = async function toastScenarios(alice, bob) {
alice.log.endGroup();
bob.log.startGroup(`clears toasts`);
- bob.log.step(`reject desktop notifications toast`);
- await rejectToast(bob, "Notifications");
- bob.log.done();
+ // bob.log.step(`reject desktop notifications toast`);
+ // await rejectToast(bob, "Notifications");
+ // bob.log.done();
+ //
+ // bob.log.step(`reject analytics toast`);
+ // await rejectToast(bob, "Help us improve Riot");
+ // bob.log.done();
- bob.log.step(`reject analytics toast`);
- await rejectToast(bob, "Help us improve Riot");
- bob.log.done();
+ while (true) {
+ try {
+ const h2Element = await bob.query('.mx_Toast_title h2');
+ const toastTitle = await bob.innerText(h2Element);
+ console.log("DEBUG closing", toastTitle);
+ const toastDismissButton = await bob.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger');
+ await toastDismissButton.click();
+ } catch (e) {
+ break;
+ }
+ }
bob.log.step(`checks no remaining toasts`);
await assertNoToasts(bob);
diff --git a/test/end-to-end-tests/src/usecases/toasts.js b/test/end-to-end-tests/src/usecases/toasts.js
index 2e88677e4b..75142ed08f 100644
--- a/test/end-to-end-tests/src/usecases/toasts.js
+++ b/test/end-to-end-tests/src/usecases/toasts.js
@@ -22,7 +22,10 @@ async function assertNoToasts(session) {
} catch (e) {
return;
}
- throw new Error('toast found when none expected');
+
+ const h2Element = await session.query('.mx_Toast_title h2');
+ const toastTitle = await session.innerText(h2Element);
+ throw new Error(`"${toastTitle}" toast found when none expected`);
}
async function assertToast(session, expectedTitle) {
From 7486338efaa31e9e2657a5458e86388c2a9e5536 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 27 May 2020 16:51:04 +0100
Subject: [PATCH 175/332] Fix.the.tests.
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
test/end-to-end-tests/src/scenarios/toast.js | 48 +++++---------------
test/end-to-end-tests/src/session.js | 4 +-
test/end-to-end-tests/src/usecases/toasts.js | 9 ++--
3 files changed, 18 insertions(+), 43 deletions(-)
diff --git a/test/end-to-end-tests/src/scenarios/toast.js b/test/end-to-end-tests/src/scenarios/toast.js
index 97b5caa14f..1206ef40b0 100644
--- a/test/end-to-end-tests/src/scenarios/toast.js
+++ b/test/end-to-end-tests/src/scenarios/toast.js
@@ -20,25 +20,13 @@ module.exports = async function toastScenarios(alice, bob) {
console.log(" checking and clearing toasts:");
alice.log.startGroup(`clears toasts`);
- // alice.log.step(`accepts desktop notifications toast`);
- // await acceptToast(alice, "Notifications");
- // alice.log.done();
- //
- // alice.log.step(`accepts analytics toast`);
- // await acceptToast(alice, "Help us improve Riot");
- // alice.log.done();
+ alice.log.step(`reject desktop notifications toast`);
+ await rejectToast(alice, "Notifications");
+ alice.log.done();
- while (true) {
- try {
- const h2Element = await alice.query('.mx_Toast_title h2');
- const toastTitle = await alice.innerText(h2Element);
- console.log("DEBUG closing", toastTitle);
- const toastDismissButton = await alice.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger');
- await toastDismissButton.click();
- } catch (e) {
- break;
- }
- }
+ alice.log.step(`accepts analytics toast`);
+ await acceptToast(alice, "Help us improve Riot");
+ alice.log.done();
alice.log.step(`checks no remaining toasts`);
await assertNoToasts(alice);
@@ -46,25 +34,13 @@ module.exports = async function toastScenarios(alice, bob) {
alice.log.endGroup();
bob.log.startGroup(`clears toasts`);
- // bob.log.step(`reject desktop notifications toast`);
- // await rejectToast(bob, "Notifications");
- // bob.log.done();
- //
- // bob.log.step(`reject analytics toast`);
- // await rejectToast(bob, "Help us improve Riot");
- // bob.log.done();
+ bob.log.step(`reject desktop notifications toast`);
+ await rejectToast(bob, "Notifications");
+ bob.log.done();
- while (true) {
- try {
- const h2Element = await bob.query('.mx_Toast_title h2');
- const toastTitle = await bob.innerText(h2Element);
- console.log("DEBUG closing", toastTitle);
- const toastDismissButton = await bob.query('.mx_Toast_buttons .mx_AccessibleButton_kind_danger');
- await toastDismissButton.click();
- } catch (e) {
- break;
- }
- }
+ bob.log.step(`reject analytics toast`);
+ await rejectToast(bob, "Help us improve Riot");
+ bob.log.done();
bob.log.step(`checks no remaining toasts`);
await assertNoToasts(bob);
diff --git a/test/end-to-end-tests/src/session.js b/test/end-to-end-tests/src/session.js
index 55c2ed440c..907ee2fb8e 100644
--- a/test/end-to-end-tests/src/session.js
+++ b/test/end-to-end-tests/src/session.js
@@ -122,8 +122,8 @@ module.exports = class RiotSession {
await input.type(text);
}
- query(selector, timeout = DEFAULT_TIMEOUT) {
- return this.page.waitForSelector(selector, {visible: true, timeout});
+ query(selector, timeout = DEFAULT_TIMEOUT, hidden = false) {
+ return this.page.waitForSelector(selector, {visible: true, timeout, hidden});
}
async queryAll(selector) {
diff --git a/test/end-to-end-tests/src/usecases/toasts.js b/test/end-to-end-tests/src/usecases/toasts.js
index 75142ed08f..204ed2b983 100644
--- a/test/end-to-end-tests/src/usecases/toasts.js
+++ b/test/end-to-end-tests/src/usecases/toasts.js
@@ -18,14 +18,13 @@ const assert = require('assert');
async function assertNoToasts(session) {
try {
- await session.query('.mx_Toast_toast');
+ await session.query('.mx_Toast_toast', 1000, true);
} catch (e) {
- return;
+ const h2Element = await session.query('.mx_Toast_title h2', 1000);
+ const toastTitle = await session.innerText(h2Element);
+ throw new Error(`"${toastTitle}" toast found when none expected`);
}
- const h2Element = await session.query('.mx_Toast_title h2');
- const toastTitle = await session.innerText(h2Element);
- throw new Error(`"${toastTitle}" toast found when none expected`);
}
async function assertToast(session, expectedTitle) {
From 71108fcf393e4648d1dfc1fd17e0b50c8423ed12 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 27 May 2020 17:02:32 +0100
Subject: [PATCH 176/332] delint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
test/end-to-end-tests/src/usecases/toasts.js | 1 -
1 file changed, 1 deletion(-)
diff --git a/test/end-to-end-tests/src/usecases/toasts.js b/test/end-to-end-tests/src/usecases/toasts.js
index 204ed2b983..db78352f2b 100644
--- a/test/end-to-end-tests/src/usecases/toasts.js
+++ b/test/end-to-end-tests/src/usecases/toasts.js
@@ -24,7 +24,6 @@ async function assertNoToasts(session) {
const toastTitle = await session.innerText(h2Element);
throw new Error(`"${toastTitle}" toast found when none expected`);
}
-
}
async function assertToast(session, expectedTitle) {
From 8b23eb1db330f58817065dda5f04070e177a0844 Mon Sep 17 00:00:00 2001
From: XoseM
Date: Wed, 27 May 2020 14:51:00 +0000
Subject: [PATCH 177/332] Translated using Weblate (Galician)
Currently translated at 49.1% (1129 of 2299 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 | 55 +++++++++++++++++++++++++++++++++++++++-
1 file changed, 54 insertions(+), 1 deletion(-)
diff --git a/src/i18n/strings/gl.json b/src/i18n/strings/gl.json
index 3e8f721ac4..d15cb56707 100644
--- a/src/i18n/strings/gl.json
+++ b/src/i18n/strings/gl.json
@@ -1115,5 +1115,58 @@
"Published addresses can be used by anyone on any server to join your room. To publish an address, it needs to be set as a local address first.": "Os enderezos publicados poden ser usados por calquera persoa ou servidor para unirse a sala. Para publicar un enderezo, primeiro debe establecerse como enderezo local.",
"Set addresses for this room so users can find this room through your homeserver (%(localDomain)s)": "Establecer enderezos para a sala para que poida ser atopada no teu servidor local (%(localDomain)s)",
"Room Settings - %(roomName)s": "Axustes da sala - %(roomName)s",
- "Delete the room address %(alias)s and remove %(name)s from the directory?": "Eliminar o enderezo da sala %(alias)s e eliminar %(name)s do directorio?"
+ "Delete the room address %(alias)s and remove %(name)s from the directory?": "Eliminar o enderezo da sala %(alias)s e eliminar %(name)s do directorio?",
+ "%(senderName)s updated the rule banning rooms matching %(glob)s for %(reason)s": "%(senderName)s actualizou a regra de bloqueo de salas con %(glob)s por %(reason)s",
+ "%(senderName)s updated the rule banning servers matching %(glob)s for %(reason)s": "%(senderName)s actualizou a regra de bloqueo de servidores con %(glob)s por %(reason)s",
+ "%(senderName)s updated a ban rule matching %(glob)s for %(reason)s": "%(senderName)s actualizou a regra de bloqueo con %(glob)s por %(reason)s",
+ "%(senderName)s created a rule banning users matching %(glob)s for %(reason)s": "%(senderName)s creou unha regra de bloqueo de usuarias con %(glob)s por %(reason)s",
+ "You signed in to a new session without verifying it:": "Conectácheste nunha nova sesión sen verificala:",
+ "Verify your other session using one of the options below.": "Verifica a túa outra sesión usando unha das opcións inferiores.",
+ "%(name)s (%(userId)s) signed in to a new session without verifying it:": "%(name)s (%(userId)s) conectouse a unha nova sesión sen verificala:",
+ "Ask this user to verify their session, or manually verify it below.": "Pídelle a usuaria que verifique a súa sesión, ou verificaa manualmente aquí.",
+ "Not Trusted": "Non confiable",
+ "Manually Verify by Text": "Verificar manualmente por texto",
+ "Interactively verify by Emoji": "Verificar interactivamente por Emoji",
+ "Done": "Feito",
+ "%(displayName)s is typing …": "%(displayName)s está escribindo…",
+ "%(names)s and %(count)s others are typing …|other": "%(names)s e outras %(count)s están escribindo…",
+ "%(names)s and %(count)s others are typing …|one": "%(names)s e outra están escribindo…",
+ "%(names)s and %(lastPerson)s are typing …": "%(names)s e %(lastPerson)s están escribindo…",
+ "Cannot reach homeserver": "Non se acadou o servidor",
+ "Ensure you have a stable internet connection, or get in touch with the server admin": "Asegúrate de que tes boa conexión a internet, ou contacta coa administración do servidor",
+ "Your Riot is misconfigured": "O teu Riot está mal configurado",
+ "Ask your Riot admin to check your config for incorrect or duplicate entries.": "Pídelle a administración do teu Riot que comprobe a configuración para entradas duplicadas ou incorrectas.",
+ "Cannot reach identity server": "Non se acadou o servidor de identidade",
+ "You can register, but some features will be unavailable until the identity server is back online. If you keep seeing this warning, check your configuration or contact a server admin.": "Podes rexistrarte, pero algunhas características non estarán dispoñibles ata que o servidor de identidade volte a conectarse. Se segues a ver este aviso, comproba os axustes ou contacta coa administración.",
+ "You can reset your password, but some features will be unavailable until the identity server is back online. If you keep seeing this warning, check your configuration or contact a server admin.": "Podes restablecer o contrasinal, pero algunhas características non estarán dispoñibles ata que o servidor de identidade se conecte. Se segues a ver este aviso comproba os axustes ou contacta coa administración.",
+ "You can log in, but some features will be unavailable until the identity server is back online. If you keep seeing this warning, check your configuration or contact a server admin.": "Podes conectarte, pero algunhas características non estarán dispoñibles ata que o servidor de identidade volte a conectarse. Se segues a ver este aviso, comproba os axustes ou contacta coa administración.",
+ "No homeserver URL provided": "Non se estableceu URL do servidor",
+ "Unexpected error resolving homeserver configuration": "Houbo un fallo ao acceder a configuración do servidor",
+ "Unexpected error resolving identity server configuration": "Houbo un fallo ao acceder a configuración do servidor de identidade",
+ "The message you are trying to send is too large.": "A mensaxe a enviar é demasiado grande.",
+ "Unable to connect to Homeserver. Retrying...": "Non se conectou co Servidor. Reintentando...",
+ "a few seconds ago": "fai uns segundos",
+ "about a minute ago": "fai un minuto",
+ "%(num)s minutes ago": "fai %(num)s minutos",
+ "about an hour ago": "fai unha hora",
+ "%(num)s hours ago": "fai %(num)s horas",
+ "about a day ago": "onte",
+ "%(num)s days ago": "fai %(num)s días",
+ "a few seconds from now": "hai só uns segundos",
+ "about a minute from now": "haberá un minuto",
+ "%(num)s minutes from now": "fará %(num)s minutos",
+ "about an hour from now": "fará unha hora",
+ "%(num)s hours from now": "fará %(num)s horas",
+ "about a day from now": "foi onte",
+ "%(num)s days from now": "fará %(num)s días",
+ "%(name)s (%(userId)s)": "%(name)s (%(userId)s)",
+ "Unrecognised address": "Enderezo non recoñecible",
+ "You do not have permission to invite people to this room.": "Non tes permiso para convidar a xente a esta sala.",
+ "User %(userId)s is already in the room": "A usuaria %(userId)s xa está na sala",
+ "User %(user_id)s does not exist": "A usuaria %(user_id)s non existe",
+ "User %(user_id)s may or may not exist": "A usuaria %(user_id)s podería non existir",
+ "The user must be unbanned before they can be invited.": "A usuria debe ser desbloqueada antes de poder convidala.",
+ "Messages in this room are end-to-end encrypted.": "As mensaxes desta sala están cifradas de extremo-a-extremo.",
+ "Messages in this room are not end-to-end encrypted.": "As mensaxes desta sala non están cifradas de extremo-a-extremo.",
+ "Messages in this room are end-to-end encrypted. Learn more & verify this user in their user profile.": "As mensaxes desta sala están cifradas de extremo-a-extremo. No perfil da usuaria tes máis info e podes verificala."
}
From 6c323a1991a841fa2a5169e91701e836538979b2 Mon Sep 17 00:00:00 2001
From: random
Date: Wed, 27 May 2020 13:26:32 +0000
Subject: [PATCH 178/332] Translated using Weblate (Italian)
Currently translated at 100.0% (2299 of 2299 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 | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/src/i18n/strings/it.json b/src/i18n/strings/it.json
index 7f6d3bf1e2..441e57395c 100644
--- a/src/i18n/strings/it.json
+++ b/src/i18n/strings/it.json
@@ -2441,5 +2441,27 @@
"Custom font size can only be between %(min)s pt and %(max)s pt": "La dimensione del carattere personalizzata può solo essere tra %(min)s pt e %(max)s pt",
"Use between %(min)s pt and %(max)s pt": "Usa tra %(min)s pt e %(max)s pt",
"Appearance": "Aspetto",
- "Use the improved room list (in development - refresh to apply changes)": "Usa l'elenco stanze migliorato (in sviluppo - ricarica per applicare le modifiche)"
+ "Use the improved room list (in development - refresh to apply changes)": "Usa l'elenco stanze migliorato (in sviluppo - ricarica per applicare le modifiche)",
+ "Room name or address": "Nome stanza o indirizzo",
+ "Joins room with given address": "Accede alla stanza con l'indirizzo dato",
+ "Unrecognised room address:": "Indirizzo stanza non riconosciuto:",
+ "Please verify the room ID or address and try again.": "Verifica l'ID o l'indirizzo della stanza e riprova.",
+ "Room ID or address of ban list": "ID o indirizzo stanza della lista ban",
+ "To link to this room, please add an address.": "Per collegare a questa stanza, aggiungi un indirizzo.",
+ "Error creating address": "Errore creazione indirizzo",
+ "There was an error creating that address. It may not be allowed by the server or a temporary failure occurred.": "Si è verificato un errore creando l'indirizzo. Potrebbe non essere permesso dal server o un problema temporaneo.",
+ "You don't have permission to delete the address.": "Non hai l'autorizzazione per eliminare l'indirizzo.",
+ "There was an error removing that address. It may no longer exist or a temporary error occurred.": "Si è verificato un errore rimuovendo l'indirizzo. Potrebbe non esistere più o essere un problema temporaneo.",
+ "Error removing address": "Errore rimozione indirizzo",
+ "Categories": "Categorie",
+ "Room address": "Indirizzo stanza",
+ "Please provide a room address": "Inserisci un indirizzo della stanza",
+ "This address is available to use": "Questo indirizzo è disponibile per l'uso",
+ "This address is already in use": "Questo indirizzo è già in uso",
+ "Set a room address to easily share your room with other people.": "Imposta un indirizzo della stanza per condividerla facilmente con le altre persone.",
+ "You've previously used a newer version of Riot with this session. To use this version again with end to end encryption, you will need to sign out and back in again.": "Hai precedentemente usato una versione più recente di Riot con questa sessione. Per usare ancora questa versione con la cifratura end to end, dovrai disconnetterti e riaccedere.",
+ "Address (optional)": "Indirizzo (facoltativo)",
+ "Delete the room address %(alias)s and remove %(name)s from the directory?": "Eliminare l'indirizzo della stanza %(alias)s e rimuovere %(name)s dalla cartella?",
+ "delete the address.": "elimina l'indirizzo.",
+ "Use a different passphrase?": "Usare una password diversa?"
}
From 687cc4e77a5f5346d7e04c6345bfd9ea8b21509d Mon Sep 17 00:00:00 2001
From: MamasLT
Date: Wed, 27 May 2020 10:08:23 +0000
Subject: [PATCH 179/332] Translated using Weblate (Lithuanian)
Currently translated at 64.6% (1486 of 2299 strings)
Translation: Riot Web/matrix-react-sdk
Translate-URL: https://translate.riot.im/projects/riot-web/matrix-react-sdk/lt/
---
src/i18n/strings/lt.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/i18n/strings/lt.json b/src/i18n/strings/lt.json
index b4afcaea26..1c2d6ba98e 100644
--- a/src/i18n/strings/lt.json
+++ b/src/i18n/strings/lt.json
@@ -697,7 +697,7 @@
"Algorithm: ": "Algoritmas: ",
"Don't ask again": "Daugiau nebeklausti",
"Set up": "Nustatyti",
- "Publish this room to the public in %(domain)s's room directory?": "Paskelbti šį kambarį į viešąjį %(domain)s kambarių katalogą?",
+ "Publish this room to the public in %(domain)s's room directory?": "Paskelbti šį kambarį viešai %(domain)s kambarių kataloge?",
"Start authentication": "Pradėti tapatybės nustatymą",
"Failed to load group members": "Nepavyko įkelti grupės dalyvių",
"Manage Integrations": "Valdyti integracijas",
From 4726ebaf9df5fe9b80bca78202169601f84eba9c Mon Sep 17 00:00:00 2001
From: yuuki-san
Date: Wed, 27 May 2020 09:26:50 +0000
Subject: [PATCH 180/332] Translated using Weblate (Slovak)
Currently translated at 68.7% (1580 of 2299 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 | 67 +++++++++++++++++++++++++++++++++++-----
1 file changed, 60 insertions(+), 7 deletions(-)
diff --git a/src/i18n/strings/sk.json b/src/i18n/strings/sk.json
index 5350b69fed..25ffab8526 100644
--- a/src/i18n/strings/sk.json
+++ b/src/i18n/strings/sk.json
@@ -1107,7 +1107,7 @@
"You've successfully verified this user.": "Úspešne ste overili tohoto používateľa.",
"Secure messages with this user are end-to-end encrypted and not able to be read by third parties.": "Zabezpečené správi s týmto používateľom sú E2E šifrované, čo znamená, že čítanie tretími stranami nie je možné.",
"Got It": "Rozumiem",
- "Verify this user by confirming the following emoji appear on their screen.": "Overte tohto používateľa tak, že zistíte, či sa na jeho obrazovke objaví nasledujúci emoji.",
+ "Verify this user by confirming the following emoji appear on their screen.": "Overte tohto používateľa tak, že zistíte, či sa na jeho obrazovke objavia nasledujúce emoji.",
"Verify this user by confirming the following number appears on their screen.": "Overte tohoto používateľa tým, že zistíte, či sa na jeho obrazovke objaví nasledujúce číslo.",
"Unable to find a supported verification method.": "Nie je možné nájsť podporovanú metódu overenia.",
"Dog": "Hlava psa",
@@ -1536,13 +1536,13 @@
"Set up encryption": "Nastaviť šifrovanie",
"Review where you’re logged in": "Zobraziť, kde ste prihlásený",
"New login. Was this you?": "Nové pihlásenie. Ste to vy?",
- "%(name)s is requesting verification": "%(name) žiada o overenie",
+ "%(name)s is requesting verification": "%(name)s žiada o overenie",
"Sign In or Create Account": "Prihlásiť sa alebo vytvoriť nový účet",
"Use your account or create a new one to continue.": "Použite váš existujúci účet alebo si vytvorte nový, aby ste mohli pokračovať.",
"Create Account": "Vytvoriť účet",
"Sign In": "Prihlásiť sa",
"Sends a message as html, without interpreting it as markdown": "Pošlite správu ako HTML, bez interpretácie v Markdowne",
- "Failed to set topic": "Nastavenie témy zlyhalo",
+ "Failed to set topic": "Nepodarilo sa nastaviť tému",
"Command failed": "Príkaz zlyhal",
"Could not find user in room": "Nepodarilo sa nájsť používateľa v miestnosti",
"Please supply a widget URL or embed code": "Prosím, zadajte URL widgetu alebo vložte kód",
@@ -1554,7 +1554,7 @@
"Incorrect recovery passphrase": "Nesprávne (dlhé) heslo pre obnovu zálohy",
"Backup could not be decrypted with this recovery passphrase: please verify that you entered the correct recovery passphrase.": "Záloha nemohla byť rozšifrovaná pomocou tohto (dlhého) helsa na obnovu zálohy: prosím, overte, či ste zadali správne (dlhé) helso na obnovu zálohy.",
"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!": "VAROVANIE: OVERENIE KĽÚČOV ZLYHALO! Podpisovaný kľúč používateľa %(userId)s a relácia %(deviceId)s je \"%(fprint)s\" čo nezodpovedá zadanému kľúču \"%(fingerprint)s\". Môže to znamenať, že vaša komunikácia je infiltrovaná!",
- "The signing key you provided matches the signing key you received from %(userId)s's session %(deviceId)s. Session marked as verified.": "Zadaný podpísaný kľúč sa zhoduje s podpísaným kľúčom od relácie %(deviceId)s používateľa %(userId)s. Relácia je označená ako overená.",
+ "The signing key you provided matches the signing key you received from %(userId)s's session %(deviceId)s. Session marked as verified.": "Zadaný podpisovací kľúč sa zhoduje s podpisovacím kľúčom od relácie %(deviceId)s používateľa %(userId)s. Relácia je označená ako overená.",
"Displays information about a user": "Zobrazuje informácie o používateľovi",
"Send a bug report with logs": "Zaslať chybové hlásenie so záznamami",
"Opens chat with the given user": "Otvorí konverzáciu s daným používateľom",
@@ -1565,7 +1565,7 @@
"%(senderName)s removed the alternative addresses %(addresses)s for this room.|other": "%(senderName)s odstránil/a alternatívne adresy %(addresses)s pre túto miestnosť.",
"%(senderName)s removed the alternative addresses %(addresses)s for this room.|one": "%(senderName)s odstránil/a alternatívnu adresu %(addresses)s pre túto miestnosť.",
"%(senderName)s changed the alternative addresses for this room.": "%(senderName)s zmenil/a alternatívne adresy pre túto miestnosť.",
- "%(senderName)s changed the main and alternative addresses for this room.": "%(senderName)s zmenil hlavnú a alternatívne adresy pre túto miestnosť.",
+ "%(senderName)s changed the main and alternative addresses for this room.": "%(senderName)s zmenil/a hlavnú a alternatívnu/e adresy pre túto miestnosť.",
"%(senderName)s changed the addresses for this room.": "%(senderName)s zmenil/a adresy pre túto miestnosť.",
"You signed in to a new session without verifying it:": "Prihlásili ste sa do novej relácie bez jej overenia:",
"Verify your other session using one of the options below.": "Overte svoje ostatné relácie pomocou jednej z nižšie uvedených možností.",
@@ -1580,7 +1580,7 @@
"about an hour ago": "približne pred hodinou",
"about a day ago": "približne deň dozadu",
"a few seconds from now": "o pár sekúnd",
- "about a minute from now": "približne o minutu",
+ "about a minute from now": "približne o minútu",
"about an hour from now": "približne o hodinu",
"about a day from now": "približne o deň",
"Support adding custom themes": "Umožniť pridávať vlastný vzhľad",
@@ -1674,5 +1674,58 @@
"Other users may not trust it": "Ostatný používatelia jej nemusia veriť",
"Verify the new login accessing your account: %(name)s": "Overte nové prihlásenie na váš účet: %(name)s",
"From %(deviceName)s (%(deviceId)s)": "Od %(deviceName)s (%(deviceId)s)",
- "This bridge was provisioned by .": "Tento most poskytuje ."
+ "This bridge was provisioned by .": "Tento most poskytuje .",
+ "Room name or address": "Meno alebo adresa miestnosti",
+ "Joins room with given address": "Pridať sa do miestnosti s danou adresou",
+ "Unrecognised room address:": "Nerozpoznaná adresa miestnosti:",
+ "Use the improved room list (in development - refresh to apply changes)": "Použiť vylepšený zoznam miestností (vo vývoji - znovunačítajte stránku pre aplikovanie zmien)",
+ "This bridge is managed by .": "Tento most spravuje .",
+ "Workspace: %(networkName)s": "Pracovisko: %(networkName)s",
+ "Channel: %(channelName)s": "Kanál: %(channelName)s",
+ "Show less": "Zobraziť menej",
+ "Show more": "Zobraziť viac",
+ "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.": "Zmena hesla reštartuje všetky šifrovacie kľúče pre všetky vaše relácie. Šifrované správy sa stanú nečitateľnými, pokiaľ najprv nevyexportujete vaše kľúče a po zmene ich nenaimportujete. V budúcnosti sa tento proces zjednoduší.",
+ "well formed": "dobre sformulované",
+ "unexpected type": "neočakávaný typ",
+ "in memory": "v pamäti",
+ "Self signing private key:": "Samo-podpísané súkromné kľúče:",
+ "cached locally": "cachenuté lokálne",
+ "not found locally": "nenájdené lokálne",
+ "User signing private key:": "Používateľom-podpísané súkromné kľúče:",
+ "Session backup key:": "Kľúč na zálohu relácie:",
+ "Homeserver feature support:": "Funkcie podporované domovským serverom:",
+ "exists": "existuje",
+ "Your homeserver does not support session management.": "Váš domovský server nepodporuje správu relácií.",
+ "Unable to load session list": "Nemožno načítať zoznam relácií",
+ "Confirm deleting these sessions by using Single Sign On to prove your identity.|other": "Potvrďte odstránenie týchto relácií použitím Jednotného prihlásenia na overenie vašej identity.",
+ "Confirm deleting these sessions by using Single Sign On to prove your identity.|one": "Potvrďte odstránenie tejto relácie použitím Jednotného prihlásenia na overenie vašej identity.",
+ "Confirm deleting these sessions": "Potvrdiť odstránenie týchto relácií",
+ "Click the button below to confirm deleting these sessions.|other": "Stlačením tlačítka potvrdíte zmazanie týchto relácií.",
+ "Click the button below to confirm deleting these sessions.|one": "Stlačením tlačítka potvrdíte zmazanie tejto relácie.",
+ "Delete sessions|other": "Zmazať relácie",
+ "Delete sessions|one": "Zmazať reláciu",
+ "Delete %(count)s sessions|one": "Zmazať %(count)s reláciu",
+ "Manage": "Spravovať",
+ "Securely cache encrypted messages locally for them to appear in search results.": "Bezpečne cachovať šifrované správy lokálne, aby sa mohli zobraziť vo vyhľadávaní.",
+ "Enable": "Povoliť",
+ "Riot is missing some components required for securely caching encrypted messages locally. If you'd like to experiment with this feature, build a custom Riot Desktop with search components added .": "Riotu chýbajú niektoré komponenty potrebné na bezpečné cachovanie šifrovaných správ lokálne. Pokiaľ chcete experimentovať s touto funkciou, spravte si svoj vlastný Riot Desktop s pridanými vyhľadávacími komponentami .",
+ "Riot can't securely cache encrypted messages locally while running in a web browser. Use Riot Desktop for encrypted messages to appear in search results.": "Riotu nemôže bezpečne cachovať šifrované správy lokálne keď beží v prehliadači. Použite Riot Desktop , aby sa šifrované správy zobrazili vo vyhľadávaní.",
+ "This session is backing up your keys. ": "Táto relácia zálohuje vaše kľúče. ",
+ "This session is not backing up your keys , but you do have an existing backup you can restore from and add to going forward.": "Táto relácia nezálohuje vaše kľúče , ale už máte jednu existujúcu zálohu z ktorej sa môžete obnoviť a postupne pridávať.",
+ "Connect this session to key backup before signing out to avoid losing any keys that may only be on this session.": "Pred odhlásením pripojte túto reláciu k zálohe kľúčov, aby ste predišli strate kľúčov, ktoré môžu byť len v tejto relácií.",
+ "Connect this session to Key Backup": "Pripojiť túto reláciu k Zálohe kľúčov",
+ "Backup has a signature from unknown session with ID %(deviceId)s": "Záloha je podpísaná z neznámej relácie s ID %(deviceId)s",
+ "Backup has a valid signature from this session": "Záloha má platný podpis z tejto relácie",
+ "Backup has an invalid signature from this session": "Záloha má neplatný podpis z tejto relácie",
+ "Backup has a valid signature from verified session ": "Záloha má platný podpis z overenej relácie ",
+ "Backup has a valid signature from unverified session ": "Záloha má platný podpis z neoverenej relácie ",
+ "Backup has an invalid signature from verified session ": "Záloha má neplatný podpis z overenej relácie ",
+ "Backup has an invalid signature from unverified session ": "Záloha má neplatný podpis z neoverenej relácie ",
+ "Backup is not signed by any of your sessions": "Záloha nemá podpis zo žiadnej vašej relácie",
+ "This backup is trusted because it has been restored on this session": "Táto záloha je dôveryhodná, lebo už bola načítaná v tejto relácií",
+ "Your keys are not being backed up from this session .": "Vaše kľúče nie sú zálohované z tejto relácie .",
+ "Enable desktop notifications for this session": "Povoliť desktopové notifikácie pre túto reláciu",
+ "Enable audible notifications for this session": "Povoliť zvukové notifikácie pre túto reláciu",
+ "Size must be a number": "Veľkosť musí byť číslo",
+ "Custom font size can only be between %(min)s pt and %(max)s pt": "Vlastná veľkosť písma môže byť len v rozmedzí %(min)s pt až %(max)s pt"
}
From 9e2d80b8c8382951424181bade0fb23446a80e77 Mon Sep 17 00:00:00 2001
From: Travis Ralston
Date: Wed, 27 May 2020 13:16:49 -0600
Subject: [PATCH 181/332] Update documentation and auth dict submissions
---
src/components/structures/auth/Registration.js | 3 +--
src/components/views/auth/InteractiveAuthEntryComponents.js | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/components/structures/auth/Registration.js b/src/components/structures/auth/Registration.js
index e8938da5c1..6349614d72 100644
--- a/src/components/structures/auth/Registration.js
+++ b/src/components/structures/auth/Registration.js
@@ -248,8 +248,7 @@ export default createReactClass({
// need to.
if (!this.state.doingUIAuth) {
await this._makeRegisterRequest(null);
- // This should never succeed since we specified an empty
- // auth object.
+ // This should never succeed since we specified no auth object.
console.log("Expecting 401 from register request but got success!");
}
} catch (e) {
diff --git a/src/components/views/auth/InteractiveAuthEntryComponents.js b/src/components/views/auth/InteractiveAuthEntryComponents.js
index e404f15d28..655452fcee 100644
--- a/src/components/views/auth/InteractiveAuthEntryComponents.js
+++ b/src/components/views/auth/InteractiveAuthEntryComponents.js
@@ -740,7 +740,7 @@ export const FallbackAuthEntry = createReactClass({
event.data === "authDone" &&
event.origin === this.props.matrixClient.getHomeserverUrl()
) {
- this.props.submitAuthDict(null);
+ this.props.submitAuthDict({});
}
},
From 73c35ff80e0a1d9a6323cbdd49df5a7fe4f83cbc Mon Sep 17 00:00:00 2001
From: Hubert Chathi
Date: Thu, 28 May 2020 00:05:45 -0400
Subject: [PATCH 182/332] set the client's pickle key if the platform can store
one
---
src/BasePlatform.js | 31 +++++++++++++++++++++++++++++++
src/Lifecycle.js | 15 ++++++++++++---
src/MatrixClientPeg.js | 1 +
3 files changed, 44 insertions(+), 3 deletions(-)
diff --git a/src/BasePlatform.js b/src/BasePlatform.js
index 8a950dc2e3..f4fa43cb10 100644
--- a/src/BasePlatform.js
+++ b/src/BasePlatform.js
@@ -190,4 +190,35 @@ export default class BasePlatform {
onKeyDown(ev: KeyboardEvent): boolean {
return false; // no shortcuts implemented
}
+
+ /**
+ * Get a previously stored pickle key. The pickle key is used for
+ * encrypting libolm objects.
+ * @param {string} userId the user ID for the user that the pickle key is for.
+ * @param {string} userId the device ID that the pickle key is for.
+ * @returns {string|null} the previously stored pickle key, or null if no
+ * pickle key has been stored.
+ */
+ async getPickleKey(userId: string, deviceId: string): string | null {
+ return null;
+ }
+
+ /**
+ * Create and store a pickle key for encrypting libolm objects.
+ * @param {string} userId the user ID for the user that the pickle key is for.
+ * @param {string} userId the device ID that the pickle key is for.
+ * @returns {string|null} the pickle key, or null if the platform does not
+ * support storing pickle keys.
+ */
+ async createPickleKey(userId: string, deviceId: string): string | null {
+ return null;
+ }
+
+ /**
+ * Delete a previously stored pickle key from storage.
+ * @param {string} userId the user ID for the user that the pickle key is for.
+ * @param {string} userId the device ID that the pickle key is for.
+ */
+ async destroyPickleKey(userId: string, deviceId: string) {
+ }
}
diff --git a/src/Lifecycle.js b/src/Lifecycle.js
index 1baa6c8e0c..598624293b 100644
--- a/src/Lifecycle.js
+++ b/src/Lifecycle.js
@@ -298,6 +298,8 @@ async function _restoreFromLocalStorage(opts) {
return false;
}
+ const pickleKey = await PlatformPeg.get().getPickleKey(userId, deviceId);
+
console.log(`Restoring session for ${userId}`);
await _doSetLoggedIn({
userId: userId,
@@ -306,6 +308,7 @@ async function _restoreFromLocalStorage(opts) {
homeserverUrl: hsUrl,
identityServerUrl: isUrl,
guest: isGuest,
+ pickleKey: pickleKey,
}, false);
return true;
} else {
@@ -348,9 +351,13 @@ async function _handleLoadSessionFailure(e) {
*
* @returns {Promise} promise which resolves to the new MatrixClient once it has been started
*/
-export function setLoggedIn(credentials) {
+export async function setLoggedIn(credentials) {
stopMatrixClient();
- return _doSetLoggedIn(credentials, true);
+ const pickleKey = credentials.userId && credentials.deviceId
+ ? await PlatformPeg.get().createPickleKey(credentials.userId, credentials.deviceId)
+ : null;
+
+ return _doSetLoggedIn(Object.assign({}, credentials, {pickleKey}), true);
}
/**
@@ -516,7 +523,9 @@ export function logout() {
}
_isLoggingOut = true;
- MatrixClientPeg.get().logout().then(onLoggedOut,
+ const client = MatrixClientPeg.get();
+ PlatformPeg.get().destroyPickleKey(client.getUserId(), client.getDeviceId());
+ client.logout().then(onLoggedOut,
(err) => {
// Just throwing an error here is going to be very unhelpful
// if you're trying to log out because your server's down and
diff --git a/src/MatrixClientPeg.js b/src/MatrixClientPeg.js
index 21f05b9759..af43705227 100644
--- a/src/MatrixClientPeg.js
+++ b/src/MatrixClientPeg.js
@@ -218,6 +218,7 @@ class _MatrixClientPeg {
accessToken: creds.accessToken,
userId: creds.userId,
deviceId: creds.deviceId,
+ pickleKey: creds.pickleKey,
timelineSupport: true,
forceTURN: !SettingsStore.getValue('webRtcAllowPeerToPeer', false),
fallbackICEServerAllowed: !!SettingsStore.getValue('fallbackICEServerAllowed'),
From 81922231ed638764083610889b7ffafc3a7467ad Mon Sep 17 00:00:00 2001
From: Jorik Schellekens
Date: Thu, 28 May 2020 13:55:07 +0100
Subject: [PATCH 183/332] Move Appearance tab to ts
---
src/components/structures/MatrixChat.tsx | 4 +-
src/components/views/elements/Field.tsx | 2 +-
...gsTab.js => AppearanceUserSettingsTab.tsx} | 133 ++++++++++-------
src/dispatcher/actions.ts | 5 +
.../payloads/RecheckThemePayload.ts | 27 ++++
.../watchers/FontWatcher.ts} | 36 +++--
src/settings/watchers/ThemeWatcher.ts | 138 ++++++++++++++++++
src/settings/watchers/Watcher.ts | 20 +++
src/theme.js | 110 +-------------
9 files changed, 295 insertions(+), 180 deletions(-)
rename src/components/views/settings/tabs/user/{AppearanceUserSettingsTab.js => AppearanceUserSettingsTab.tsx} (73%)
create mode 100644 src/dispatcher/payloads/RecheckThemePayload.ts
rename src/{FontWatcher.js => settings/watchers/FontWatcher.ts} (51%)
create mode 100644 src/settings/watchers/ThemeWatcher.ts
create mode 100644 src/settings/watchers/Watcher.ts
diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx
index 1200fcaf7a..f6848feb03 100644
--- a/src/components/structures/MatrixChat.tsx
+++ b/src/components/structures/MatrixChat.tsx
@@ -58,8 +58,8 @@ import ResizeNotifier from "../../utils/ResizeNotifier";
import AutoDiscoveryUtils, { ValidatedServerConfig } from "../../utils/AutoDiscoveryUtils";
import DMRoomMap from '../../utils/DMRoomMap';
import { countRoomsWithNotif } from '../../RoomNotifs';
-import { ThemeWatcher } from "../../theme";
-import { FontWatcher } from '../../FontWatcher';
+import ThemeWatcher from "../../settings/watchers/ThemeWatcher";
+import { FontWatcher } from '../../settings/watchers/FontWatcher';
import { storeRoomAliasInCache } from '../../RoomAliasCache';
import { defer, IDeferred } from "../../utils/promise";
import ToastStore from "../../stores/ToastStore";
diff --git a/src/components/views/elements/Field.tsx b/src/components/views/elements/Field.tsx
index 39ed2df9f9..771d2182ea 100644
--- a/src/components/views/elements/Field.tsx
+++ b/src/components/views/elements/Field.tsx
@@ -34,7 +34,7 @@ interface IProps extends React.InputHTMLAttributes
- element?: "input" | " select" | "textarea",
+ element?: "input" | "select" | "textarea",
// The field's type (when used as an ). Defaults to "text".
type?: string,
// id of a element for suggestions
diff --git a/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.js b/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx
similarity index 73%
rename from src/components/views/settings/tabs/user/AppearanceUserSettingsTab.js
rename to src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx
index 5b49dd0abd..702fed7b4f 100644
--- a/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.js
+++ b/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx
@@ -20,34 +20,61 @@ import React from 'react';
import {_t} from "../../../../../languageHandler";
import SettingsStore, {SettingLevel} from "../../../../../settings/SettingsStore";
import * as sdk from "../../../../../index";
-import {enumerateThemes, ThemeWatcher} from "../../../../../theme";
+import { enumerateThemes } from "../../../../../theme";
+import ThemeWatcher from "../../../../../settings/watchers/ThemeWatcher";
import Field from "../../../elements/Field";
import Slider from "../../../elements/Slider";
import AccessibleButton from "../../../elements/AccessibleButton";
import dis from "../../../../../dispatcher/dispatcher";
-import { FontWatcher } from "../../../../../FontWatcher";
+import { FontWatcher } from "../../../../../settings/watchers/FontWatcher";
+import { RecheckThemePayload } from '../../../../../dispatcher/payloads/RecheckThemePayload';
+import { Action } from '../../../../../dispatcher/actions';
+import { IValidationResult, IFieldState } from '../../../elements/Validation';
-export default class AppearanceUserSettingsTab extends React.Component {
- constructor() {
- super();
+interface IProps {
+}
+
+interface IState extends IThemeState {
+ // String displaying the current selected fontSize.
+ // Needs to be string for things like '17.' without
+ // trailing 0s.
+ fontSize: string,
+ customThemeUrl: string,
+ customThemeMessage: CustomThemeMessage,
+ useCustomFontSize: boolean,
+}
+
+export type CustomThemeMessage = {isError: boolean, text: string};
+
+interface IThemeState {
+ theme: string,
+ useSystemTheme: boolean,
+}
+
+export default class AppearanceUserSettingsTab extends React.Component {
+
+ private themeTimer: NodeJS.Timeout;
+
+ constructor(props: IProps) {
+ super(props);
this.state = {
- fontSize: SettingsStore.getValue("fontSize", null),
- ...this._calculateThemeState(),
+ fontSize: SettingsStore.getValue("fontSize", null).toString(),
+ ...this.calculateThemeState(),
customThemeUrl: "",
customThemeMessage: {isError: false, text: ""},
useCustomFontSize: SettingsStore.getValue("useCustomFontSize"),
};
}
- _calculateThemeState() {
+ private calculateThemeState(): IThemeState {
// We have to mirror the logic from ThemeWatcher.getEffectiveTheme so we
// show the right values for things.
- const themeChoice = SettingsStore.getValueAt(SettingLevel.ACCOUNT, "theme");
- const systemThemeExplicit = SettingsStore.getValueAt(
+ const themeChoice: string = SettingsStore.getValueAt(SettingLevel.ACCOUNT, "theme");
+ const systemThemeExplicit: boolean = SettingsStore.getValueAt(
SettingLevel.DEVICE, "use_system_theme", null, false, true);
- const themeExplicit = SettingsStore.getValueAt(
+ const themeExplicit: string = SettingsStore.getValueAt(
SettingLevel.DEVICE, "theme", null, false, true);
// If the user has enabled system theme matching, use that.
@@ -73,15 +100,15 @@ export default class AppearanceUserSettingsTab extends React.Component {
};
}
- _onThemeChange = (e) => {
+ private onThemeChange(e: React.ChangeEvent): void {
const newTheme = e.target.value;
if (this.state.theme === newTheme) return;
// doing getValue in the .catch will still return the value we failed to set,
// so remember what the value was before we tried to set it so we can revert
- const oldTheme = SettingsStore.getValue('theme');
+ const oldTheme: string = SettingsStore.getValue('theme');
SettingsStore.setValue("theme", null, SettingLevel.ACCOUNT, newTheme).catch(() => {
- dis.dispatch({action: 'recheck_theme'});
+ dis.dispatch({action: Action.RecheckTheme});
this.setState({theme: oldTheme});
});
this.setState({theme: newTheme});
@@ -91,23 +118,21 @@ export default class AppearanceUserSettingsTab extends React.Component {
// XXX: The local echoed value appears to be unreliable, in particular
// when settings custom themes(!) so adding forceTheme to override
// the value from settings.
- dis.dispatch({action: 'recheck_theme', forceTheme: newTheme});
+ dis.dispatch({action: Action.RecheckTheme, forceTheme: newTheme});
};
- _onUseSystemThemeChanged = (checked) => {
+ private onUseSystemThemeChanged(checked: boolean) {
this.setState({useSystemTheme: checked});
SettingsStore.setValue("use_system_theme", null, SettingLevel.DEVICE, checked);
- dis.dispatch({action: 'recheck_theme'});
+ dis.dispatch({action: Action.RecheckTheme});
};
- _onFontSizeChanged = (size) => {
- this.setState({fontSize: size});
+ private onFontSizeChanged(size: number) {
+ this.setState({fontSize: size.toString()});
SettingsStore.setValue("fontSize", null, SettingLevel.DEVICE, size);
};
- _onValidateFontSize = ({value}) => {
- console.log({value});
-
+ private async onValidateFontSize({value}: Pick): Promise {
const parsedSize = parseFloat(value);
const min = FontWatcher.MIN_SIZE;
const max = FontWatcher.MAX_SIZE;
@@ -127,17 +152,18 @@ export default class AppearanceUserSettingsTab extends React.Component {
return {valid: true, feedback: _t('Use between %(min)s pt and %(max)s pt', {min, max})};
}
- _onAddCustomTheme = async () => {
- let currentThemes = SettingsStore.getValue("custom_themes");
+ private async onAddCustomTheme() {
+ let currentThemes: string[] = SettingsStore.getValue("custom_themes");
if (!currentThemes) currentThemes = [];
currentThemes = currentThemes.map(c => c); // cheap clone
- if (this._themeTimer) {
- clearTimeout(this._themeTimer);
+ if (this.themeTimer) {
+ clearTimeout(this.themeTimer);
}
try {
const r = await fetch(this.state.customThemeUrl);
+ // XXX: need some schema for this
const themeInfo = await r.json();
if (!themeInfo || typeof(themeInfo['name']) !== 'string' || typeof(themeInfo['colors']) !== 'object') {
this.setState({customThemeMessage: {text: _t("Invalid theme schema."), isError: true}});
@@ -153,42 +179,32 @@ export default class AppearanceUserSettingsTab extends React.Component {
await SettingsStore.setValue("custom_themes", null, SettingLevel.ACCOUNT, currentThemes);
this.setState({customThemeUrl: "", customThemeMessage: {text: _t("Theme added!"), isError: false}});
- this._themeTimer = setTimeout(() => {
+ this.themeTimer = setTimeout(() => {
this.setState({customThemeMessage: {text: "", isError: false}});
}, 3000);
};
- _onCustomThemeChange = (e) => {
+ private onCustomThemeChange(e: React.ChangeEvent) {
this.setState({customThemeUrl: e.target.value});
};
- render() {
- return (
-
-
{_t("Appearance")}
- {this._renderThemeSection()}
- {SettingsStore.isFeatureEnabled("feature_font_scaling") ? this._renderFontSection() : null}
-
- );
- }
-
- _renderThemeSection() {
+ private renderThemeSection() {
const SettingsFlag = sdk.getComponent("views.elements.SettingsFlag");
const LabelledToggleSwitch = sdk.getComponent("views.elements.LabelledToggleSwitch");
const themeWatcher = new ThemeWatcher();
- let systemThemeSection;
+ let systemThemeSection: JSX.Element;
if (themeWatcher.isSystemThemeSupported()) {
systemThemeSection =
;
}
- let customThemeForm;
+ let customThemeForm: JSX.Element;
if (SettingsStore.isFeatureEnabled("feature_custom_themes")) {
let messageElement = null;
if (this.state.customThemeMessage.text) {
@@ -200,17 +216,17 @@ export default class AppearanceUserSettingsTab extends React.Component {
}
customThemeForm = (