Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/fix/18088

 Conflicts:
	src/components/structures/LoggedInView.tsx
	src/stores/SpaceStore.tsx
This commit is contained in:
Michael Telatynski 2021-09-06 11:41:09 +01:00
commit a688e5b8b3
318 changed files with 7386 additions and 4032 deletions

View file

@ -172,6 +172,15 @@ export const SETTINGS: {[setting: string]: ISetting} = {
supportedLevels: LEVELS_FEATURE,
default: false,
},
"feature_thread": {
isFeature: true,
// Requires a reload as we change an option flag on the `js-sdk`
// And the entire sync history needs to be parsed again
controller: new ReloadOnChangeController(),
displayName: _td("Threaded messaging"),
supportedLevels: LEVELS_FEATURE,
default: false,
},
"feature_custom_status": {
isFeature: true,
displayName: _td("Custom user status messages"),
@ -194,7 +203,7 @@ export const SETTINGS: {[setting: string]: ISetting} = {
},
"feature_many_integration_managers": {
isFeature: true,
displayName: _td("Multiple integration managers"),
displayName: _td("Multiple integration managers (requires manual setup)"),
supportedLevels: LEVELS_FEATURE,
default: false,
},
@ -237,12 +246,6 @@ export const SETTINGS: {[setting: string]: ISetting} = {
default: false,
controller: new PseudonymousAnalyticsController(),
},
"advancedRoomListLogging": {
// TODO: Remove flag before launch: https://github.com/vector-im/element-web/issues/14231
displayName: _td("Enable advanced debugging for the room list"),
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
default: false,
},
"doNotDisturb": {
supportedLevels: [SettingLevel.DEVICE],
default: false,
@ -351,9 +354,14 @@ export const SETTINGS: {[setting: string]: ISetting} = {
displayName: _td('Always show message timestamps'),
default: false,
},
"autoplayGifsAndVideos": {
"autoplayGifs": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Autoplay GIFs and videos'),
displayName: _td('Autoplay GIFs'),
default: false,
},
"autoplayVideo": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Autoplay videos'),
default: false,
},
"enableSyntaxHighlightLanguageDetection": {
@ -629,7 +637,7 @@ export const SETTINGS: {[setting: string]: ISetting} = {
},
"lowBandwidth": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG,
displayName: _td('Low bandwidth mode'),
displayName: _td('Low bandwidth mode (requires compatible homeserver)'),
default: false,
controller: new ReloadOnChangeController(),
},

View file

@ -21,6 +21,7 @@ import { SettingLevel } from "../SettingLevel";
// XXX: This feels wrong.
import { PushProcessor } from "matrix-js-sdk/src/pushprocessor";
import { PushRuleActionName } from "matrix-js-sdk/src/@types/PushRules";
// .m.rule.master being enabled means all events match that push rule
// default action on this rule is dont_notify, but it could be something else
@ -35,7 +36,7 @@ export function isPushNotifyDisabled(): boolean {
}
// If the rule is enabled then check it does not notify on everything
return masterRule.enabled && !masterRule.actions.includes("notify");
return masterRule.enabled && !masterRule.actions.includes(PushRuleActionName.Notify);
}
function getNotifier(): any { // TODO: [TS] Formal type that doesn't cause a cyclical reference.

View file

@ -110,6 +110,21 @@ export default class AccountSettingsHandler extends MatrixClientBackedSettingsHa
return content ? content['enabled'] : null;
}
// Special case for autoplaying videos and GIFs
if (["autoplayGifs", "autoplayVideo"].includes(settingName)) {
const settings = this.getSettings() || {};
const value = settings[settingName];
// Fallback to old combined setting
if (value === null || value === undefined) {
const oldCombinedValue = settings["autoplayGifsAndVideos"];
// Write, so that we can remove this in the future
this.setValue("autoplayGifs", roomId, oldCombinedValue);
this.setValue("autoplayVideo", roomId, oldCombinedValue);
return oldCombinedValue;
}
return value;
}
const settings = this.getSettings() || {};
let preferredValue = settings[settingName];

View file

@ -71,7 +71,13 @@ export default class DeviceSettingsHandler extends SettingsHandler {
// Special case for old useIRCLayout setting
if (settingName === "layout") {
const settings = this.getSettings() || {};
if (settings["useIRCLayout"]) return Layout.IRC;
if (settings["useIRCLayout"]) {
// Set the new layout setting and delete the old one so that we
// can delete this block of code after some time
settings["layout"] = Layout.IRC;
delete settings["useIRCLayout"];
localStorage.setItem("mx_local_settings", JSON.stringify(settings));
}
return settings[settingName];
}