Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/nvl/rich_quoting
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> # Conflicts: # src/components/views/messages/TextualBody.js
This commit is contained in:
commit
1bc9d344ae
187 changed files with 5637 additions and 1498 deletions
|
@ -222,9 +222,9 @@ export default class SettingsStore {
|
|||
|
||||
if (explicit) {
|
||||
const handler = handlers[level];
|
||||
if (!handler) return SettingsStore._tryControllerOverride(settingName, level, roomId, null);
|
||||
if (!handler) return SettingsStore._tryControllerOverride(settingName, level, roomId, null, null);
|
||||
const value = handler.getValue(settingName, roomId);
|
||||
return SettingsStore._tryControllerOverride(settingName, level, roomId, value);
|
||||
return SettingsStore._tryControllerOverride(settingName, level, roomId, value, level);
|
||||
}
|
||||
|
||||
for (let i = minIndex; i < levelOrder.length; i++) {
|
||||
|
@ -234,17 +234,17 @@ export default class SettingsStore {
|
|||
|
||||
const value = handler.getValue(settingName, roomId);
|
||||
if (value === null || value === undefined) continue;
|
||||
return SettingsStore._tryControllerOverride(settingName, level, roomId, value);
|
||||
return SettingsStore._tryControllerOverride(settingName, level, roomId, value, levelOrder[i]);
|
||||
}
|
||||
|
||||
return SettingsStore._tryControllerOverride(settingName, level, roomId, null);
|
||||
return SettingsStore._tryControllerOverride(settingName, level, roomId, null, null);
|
||||
}
|
||||
|
||||
static _tryControllerOverride(settingName, level, roomId, calculatedValue) {
|
||||
static _tryControllerOverride(settingName, level, roomId, calculatedValue, calculatedAtLevel) {
|
||||
const controller = SETTINGS[settingName].controller;
|
||||
if (!controller) return calculatedValue;
|
||||
|
||||
const actualValue = controller.getValueOverride(level, roomId, calculatedValue);
|
||||
const actualValue = controller.getValueOverride(level, roomId, calculatedValue, calculatedAtLevel);
|
||||
if (actualValue !== undefined && actualValue !== null) return actualValue;
|
||||
return calculatedValue;
|
||||
}
|
||||
|
|
|
@ -35,11 +35,11 @@ function isMasterRuleEnabled() {
|
|||
}
|
||||
|
||||
export class NotificationsEnabledController extends SettingController {
|
||||
getValueOverride(level, roomId, calculatedValue) {
|
||||
getValueOverride(level, roomId, calculatedValue, calculatedAtLevel) {
|
||||
const Notifier = require('../../Notifier'); // avoids cyclical references
|
||||
if (!Notifier.isPossible()) return false;
|
||||
|
||||
if (calculatedValue === null) {
|
||||
if (calculatedValue === null || calculatedAtLevel === "default") {
|
||||
return isMasterRuleEnabled();
|
||||
}
|
||||
|
||||
|
|
|
@ -31,9 +31,11 @@ export default class SettingController {
|
|||
* @param {String} roomId The room ID, may be null.
|
||||
* @param {*} calculatedValue The value that the handlers think the setting should be,
|
||||
* may be null.
|
||||
* @param {string} calculatedAtLevel The level for which the calculated value was
|
||||
* calculated at. May be null.
|
||||
* @return {*} The value that should be used, or null if no override is applicable.
|
||||
*/
|
||||
getValueOverride(level, roomId, calculatedValue) {
|
||||
getValueOverride(level, roomId, calculatedValue, calculatedAtLevel) {
|
||||
return null; // no override
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue