Page MenuHomePhabricator

D6893.diff
No OneTemporary

D6893.diff

diff --git a/keyserver/src/push/send.js b/keyserver/src/push/send.js
--- a/keyserver/src/push/send.js
+++ b/keyserver/src/push/send.js
@@ -262,6 +262,41 @@
deliveryPromises.push(deliveryPromise);
}
}
+ const macosVersionsToTokens = byPlatform.get('macos');
+ if (macosVersionsToTokens) {
+ for (const [codeVersion, deviceTokens] of macosVersionsToTokens) {
+ const platformDetails = { platform: 'macos', codeVersion };
+ const shimmedNewRawMessageInfos = shimUnsupportedRawMessageInfos(
+ newRawMessageInfos,
+ platformDetails,
+ );
+ const deliveryPromise = (async () => {
+ const notification = await prepareAPNsNotification({
+ allMessageInfos,
+ newRawMessageInfos: shimmedNewRawMessageInfos,
+ threadInfo,
+ collapseKey: notifInfo.collapseKey,
+ badgeOnly,
+ unreadCount: unreadCounts[userID],
+ platformDetails,
+ notifTargetUserInfo: {
+ id: userID,
+ username,
+ },
+ });
+ return await sendAPNsNotification(
+ 'macos',
+ notification,
+ [...deviceTokens],
+ {
+ ...notificationInfo,
+ codeVersion,
+ },
+ );
+ })();
+ deliveryPromises.push(deliveryPromise);
+ }
+ }
for (const newMessageInfo of remainingNewMessageInfos) {
const newDBID = dbIDs.shift();
@@ -580,7 +615,11 @@
notifTargetUserInfo,
getENSNames,
);
- if (!badgeOnly) {
+
+ // We don't include alert's body on macos because we
+ // handle displaying the notification ourselves and
+ // we don't want macOS to display it automatically.
+ if (!badgeOnly && platformDetails.platform !== 'macos') {
notification.body = merged;
notification.sound = 'default';
}

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 9, 12:07 PM (40 m, 19 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2834583
Default Alt Text
D6893.diff (1 KB)

Event Timeline