diff --git a/res/css/views/settings/tabs/user/_SecurityUserSettingsTab.scss b/res/css/views/settings/tabs/user/_SecurityUserSettingsTab.scss
index 8700f8747d..d6466a03f9 100644
--- a/res/css/views/settings/tabs/user/_SecurityUserSettingsTab.scss
+++ b/res/css/views/settings/tabs/user/_SecurityUserSettingsTab.scss
@@ -63,4 +63,25 @@ limitations under the License.
font-size: inherit;
}
}
+
+ .mx_SecurityUserSettingsTab_warning {
+ color: $notice-primary-color;
+ position: relative;
+ padding-left: 40px;
+ margin-top: 30px;
+
+ &::before {
+ mask-repeat: no-repeat;
+ mask-position: 0 center;
+ mask-size: $font-24px;
+ position: absolute;
+ width: $font-24px;
+ height: $font-24px;
+ content: "";
+ top: 0;
+ left: 0;
+ background-color: $notice-primary-color;
+ mask-image: url('$(res)/img/feather-customised/alert-triangle.svg');
+ }
+ }
}
diff --git a/res/img/feather-customised/alert-triangle.svg b/res/img/feather-customised/alert-triangle.svg
new file mode 100644
index 0000000000..ceb664790f
--- /dev/null
+++ b/res/img/feather-customised/alert-triangle.svg
@@ -0,0 +1,5 @@
+
diff --git a/src/DeviceListener.ts b/src/DeviceListener.ts
index a5175b3220..e73b56416b 100644
--- a/src/DeviceListener.ts
+++ b/src/DeviceListener.ts
@@ -22,13 +22,13 @@ import {
import {
hideToast as hideSetupEncryptionToast,
Kind as SetupKind,
- Kind,
showToast as showSetupEncryptionToast
} from "./toasts/SetupEncryptionToast";
import {
hideToast as hideUnverifiedSessionsToast,
showToast as showUnverifiedSessionsToast
} from "./toasts/UnverifiedSessionToast";
+import {privateShouldBeEncrypted} from "./createRoom";
const KEY_BACKUP_POLL_INTERVAL = 5 * 60 * 1000;
@@ -169,6 +169,14 @@ export default class DeviceListener {
return this.keyBackupInfo;
}
+ private shouldShowSetupEncryptionToast() {
+ // In a default configuration, show the toasts. If the well-known config causes e2ee default to be false
+ // then do not show the toasts until user is in at least one encrypted room.
+ if (privateShouldBeEncrypted()) return true;
+ const cli = MatrixClientPeg.get();
+ return cli && cli.getRooms().some(r => cli.isRoomEncrypted(r.roomId));
+ }
+
async _recheck() {
const cli = MatrixClientPeg.get();
@@ -184,7 +192,7 @@ export default class DeviceListener {
if (this.dismissedThisDeviceToast || crossSigningReady) {
hideSetupEncryptionToast();
- } else {
+ } else if (this.shouldShowSetupEncryptionToast()) {
// make sure our keys are finished downloading
await cli.downloadKeys([cli.getUserId()]);
// cross signing isn't enabled - nag to enable it
@@ -196,10 +204,10 @@ export default class DeviceListener {
const backupInfo = await this._getKeyBackupInfo();
if (backupInfo) {
// No cross-signing on account but key backup available (upgrade encryption)
- showSetupEncryptionToast(Kind.UPGRADE_ENCRYPTION);
+ showSetupEncryptionToast(SetupKind.UPGRADE_ENCRYPTION);
} else {
// No cross-signing or key backup on account (set up encryption)
- showSetupEncryptionToast(Kind.SET_UP_ENCRYPTION);
+ showSetupEncryptionToast(SetupKind.SET_UP_ENCRYPTION);
}
}
}
diff --git a/src/Lifecycle.js b/src/Lifecycle.js
index d018ea99aa..96cefaf593 100644
--- a/src/Lifecycle.js
+++ b/src/Lifecycle.js
@@ -622,7 +622,7 @@ async function startMatrixClient(startSyncing=true) {
}
// Now that we have a MatrixClientPeg, update the Jitsi info
- await Jitsi.getInstance().update();
+ await Jitsi.getInstance().start();
// dispatch that we finished starting up to wire up any other bits
// of the matrix client that cannot be set prior to starting up.
diff --git a/src/MatrixClientPeg.ts b/src/MatrixClientPeg.ts
index c6ee6c546f..bc550c1935 100644
--- a/src/MatrixClientPeg.ts
+++ b/src/MatrixClientPeg.ts
@@ -49,6 +49,7 @@ export interface IOpts {
initialSyncLimit?: number;
pendingEventOrdering?: "detached" | "chronological";
lazyLoadMembers?: boolean;
+ clientWellKnownPollPeriod?: number;
}
export interface IMatrixClientPeg {
@@ -209,6 +210,7 @@ class _MatrixClientPeg implements IMatrixClientPeg {
// the react sdk doesn't work without this, so don't allow
opts.pendingEventOrdering = "detached";
opts.lazyLoadMembers = true;
+ opts.clientWellKnownPollPeriod = 2 * 60 * 60; // 2 hours
// Connect the matrix client to the dispatcher and setting handlers
MatrixActionCreators.start(this.matrixClient);
diff --git a/src/components/views/dialogs/CreateRoomDialog.js b/src/components/views/dialogs/CreateRoomDialog.js
index 87fbf3de02..ce7ac6e59c 100644
--- a/src/components/views/dialogs/CreateRoomDialog.js
+++ b/src/components/views/dialogs/CreateRoomDialog.js
@@ -24,6 +24,7 @@ import withValidation from '../elements/Validation';
import { _t } from '../../../languageHandler';
import {MatrixClientPeg} from '../../../MatrixClientPeg';
import {Key} from "../../../Keyboard";
+import {privateShouldBeEncrypted} from "../../../createRoom";
export default createReactClass({
displayName: 'CreateRoomDialog',
@@ -36,7 +37,7 @@ export default createReactClass({
const config = SdkConfig.get();
return {
isPublic: this.props.defaultPublic || false,
- isEncrypted: true,
+ isEncrypted: privateShouldBeEncrypted(),
name: "",
topic: "",
alias: "",
@@ -193,6 +194,13 @@ export default createReactClass({
let e2eeSection;
if (!this.state.isPublic) {
+ let microcopy;
+ if (privateShouldBeEncrypted()) {
+ microcopy = _t("You can’t disable this later. Bridges & most bots won’t work yet.");
+ } else {
+ microcopy = _t("Your server admin has disabled end-to-end encryption by default " +
+ "in private rooms & Direct Messages.");
+ }
e2eeSection = { _t("You can’t disable this later. Bridges & most bots won’t work yet.") } { microcopy }