Merge branch 'develop' into joriks/font-scaling-message-preview
This commit is contained in:
commit
15881fc7d0
101 changed files with 1697 additions and 739 deletions
|
@ -140,9 +140,10 @@ export const SETTINGS = {
|
|||
},
|
||||
"feature_new_room_list": {
|
||||
isFeature: true,
|
||||
displayName: _td("Use the improved room list (in development - refresh to apply changes)"),
|
||||
displayName: _td("Use the improved room list (in development - will refresh to apply changes)"),
|
||||
supportedLevels: LEVELS_FEATURE,
|
||||
default: false,
|
||||
controller: new ReloadOnChangeController(),
|
||||
},
|
||||
"feature_custom_themes": {
|
||||
isFeature: true,
|
||||
|
@ -520,11 +521,6 @@ export const SETTINGS = {
|
|||
displayName: _td("Enable message search in encrypted rooms"),
|
||||
default: true,
|
||||
},
|
||||
"keepSecretStoragePassphraseForSession": {
|
||||
supportedLevels: ['device', 'config'],
|
||||
displayName: _td("Keep recovery passphrase in memory for this session"),
|
||||
default: false,
|
||||
},
|
||||
"crawlerSleepTime": {
|
||||
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
|
||||
displayName: _td("How fast should messages be downloaded."),
|
||||
|
|
|
@ -20,18 +20,20 @@ import {MatrixClientPeg} from '../../MatrixClientPeg';
|
|||
// XXX: This feels wrong.
|
||||
import {PushProcessor} from "matrix-js-sdk/src/pushprocessor";
|
||||
|
||||
function isMasterRuleEnabled() {
|
||||
// .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
|
||||
function isPushNotifyDisabled() {
|
||||
// Return the value of the master push rule as a default
|
||||
const processor = new PushProcessor(MatrixClientPeg.get());
|
||||
const masterRule = processor.getPushRuleById(".m.rule.master");
|
||||
|
||||
if (!masterRule) {
|
||||
console.warn("No master push rule! Notifications are disabled for this user.");
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Why enabled == false means "enabled" is beyond me.
|
||||
return !masterRule.enabled;
|
||||
// If the rule is enabled then check it does not notify on everything
|
||||
return masterRule.enabled && !masterRule.actions.includes("notify");
|
||||
}
|
||||
|
||||
function getNotifier() {
|
||||
|
@ -45,7 +47,7 @@ export class NotificationsEnabledController extends SettingController {
|
|||
if (!getNotifier().isPossible()) return false;
|
||||
|
||||
if (calculatedValue === null || calculatedAtLevel === "default") {
|
||||
return isMasterRuleEnabled();
|
||||
return !isPushNotifyDisabled();
|
||||
}
|
||||
|
||||
return calculatedValue;
|
||||
|
@ -63,7 +65,7 @@ export class NotificationBodyEnabledController extends SettingController {
|
|||
if (!getNotifier().isPossible()) return false;
|
||||
|
||||
if (calculatedValue === null) {
|
||||
return isMasterRuleEnabled();
|
||||
return !isPushNotifyDisabled();
|
||||
}
|
||||
|
||||
return calculatedValue;
|
||||
|
|
|
@ -39,7 +39,7 @@ export default class LocalEchoWrapper extends SettingsHandler {
|
|||
const cacheRoomId = roomId ? roomId : "UNDEFINED"; // avoid weird keys
|
||||
const bySetting = this._cache[settingName];
|
||||
if (bySetting && bySetting.hasOwnProperty(cacheRoomId)) {
|
||||
return bySetting[roomId];
|
||||
return bySetting[cacheRoomId];
|
||||
}
|
||||
|
||||
return this._handler.getValue(settingName, roomId);
|
||||
|
|
|
@ -15,6 +15,6 @@ limitations under the License.
|
|||
*/
|
||||
|
||||
export default interface IWatcher {
|
||||
start(): void
|
||||
stop(): void
|
||||
start(): void;
|
||||
stop(): void;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue