Enable notifications for disappearing messages on macOS 12.0.1 and above
Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
parent
17bee00821
commit
851e7c7f5c
|
@ -7,6 +7,7 @@ import { Sound } from '../util/Sound';
|
||||||
import {
|
import {
|
||||||
AudioNotificationSupport,
|
AudioNotificationSupport,
|
||||||
getAudioNotificationSupport,
|
getAudioNotificationSupport,
|
||||||
|
shouldHideExpiringMessageBody,
|
||||||
} from '../types/Settings';
|
} from '../types/Settings';
|
||||||
import * as OS from '../OS';
|
import * as OS from '../OS';
|
||||||
import * as log from '../logging/log';
|
import * as log from '../logging/log';
|
||||||
|
@ -284,9 +285,7 @@ class NotificationService extends EventEmitter {
|
||||||
notificationTitle = senderTitle;
|
notificationTitle = senderTitle;
|
||||||
({ notificationIconUrl } = notificationData);
|
({ notificationIconUrl } = notificationData);
|
||||||
|
|
||||||
const shouldHideExpiringMessageBody =
|
if (isExpiringMessage && shouldHideExpiringMessageBody()) {
|
||||||
isExpiringMessage && (OS.isMacOS() || OS.isWindows());
|
|
||||||
if (shouldHideExpiringMessageBody) {
|
|
||||||
notificationMessage = i18n('newMessage');
|
notificationMessage = i18n('newMessage');
|
||||||
} else if (userSetting === NotificationSetting.NameOnly) {
|
} else if (userSetting === NotificationSetting.NameOnly) {
|
||||||
if (reaction) {
|
if (reaction) {
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
// Copyright 2018-2021 Signal Messenger, LLC
|
// Copyright 2018-2021 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
import semver from 'semver';
|
||||||
|
import os from 'os';
|
||||||
|
|
||||||
import * as OS from '../OS';
|
import * as OS from '../OS';
|
||||||
import { isProduction } from '../util/version';
|
import { isProduction } from '../util/version';
|
||||||
|
|
||||||
|
@ -61,3 +64,6 @@ export const isSystemTraySupported = (appVersion: string): boolean =>
|
||||||
|
|
||||||
export const isAutoDownloadUpdatesSupported = (): boolean =>
|
export const isAutoDownloadUpdatesSupported = (): boolean =>
|
||||||
OS.isWindows() || OS.isMacOS();
|
OS.isWindows() || OS.isMacOS();
|
||||||
|
|
||||||
|
export const shouldHideExpiringMessageBody = (): boolean =>
|
||||||
|
OS.isWindows() || (OS.isMacOS() && semver.lt(os.release(), '21.1.0'));
|
||||||
|
|
Loading…
Reference in New Issue