Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3720882
D6893.id23302.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D6893.id23302.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 9, 12:55 PM (1 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2834583
Default Alt Text
D6893.id23302.diff (1 KB)
Attached To
Mode
D6893: [keyserver] Send macos notifications
Attached
Detach File
Event Timeline
Log In to Comment