Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3346235
D10188.id34277.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D10188.id34277.diff
View Options
diff --git a/keyserver/src/push/crypto.js b/keyserver/src/push/crypto.js
--- a/keyserver/src/push/crypto.js
+++ b/keyserver/src/push/crypto.js
@@ -35,7 +35,8 @@
}> {
invariant(
!notification.collapseId,
- 'Collapsible notifications encryption currently not implemented',
+ `Collapse ID can't be directly stored in apn.Notification object due ` +
+ `to security reasons. Please put it in payload property`,
);
const encryptedNotification = new apn.Notification();
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
@@ -913,7 +913,7 @@
platformDetails,
} = convertedData;
- const canDecryptNonCollapsibleTextNotifs =
+ const canDecryptNonCollapsibleTextIOSNotifs =
platformDetails.codeVersion && platformDetails.codeVersion > 222;
const isNonCollapsibleTextNotification =
@@ -921,13 +921,14 @@
newRawMessageInfo => newRawMessageInfo.type === messageTypes.TEXT,
) && !collapseKey;
- const canDecryptAllNotifTypes =
+ const canDecryptAllIOSNotifs =
platformDetails.codeVersion && platformDetails.codeVersion >= 267;
- const canDecryptIOSNotifs =
+ const canDecryptIOSNotif =
platformDetails.platform === 'ios' &&
- (canDecryptAllNotifTypes ||
- (isNonCollapsibleTextNotification && canDecryptNonCollapsibleTextNotifs));
+ (canDecryptAllIOSNotifs ||
+ (isNonCollapsibleTextNotification &&
+ canDecryptNonCollapsibleTextIOSNotifs));
const isStaffOrDev = isStaff(userID) || isDev;
const canDecryptMacOSNotifs =
@@ -938,7 +939,7 @@
majorDesktop: 9,
});
- const shouldBeEncrypted = canDecryptIOSNotifs || canDecryptMacOSNotifs;
+ const shouldBeEncrypted = canDecryptIOSNotif || canDecryptMacOSNotifs;
const uniqueID = uuidv4();
const notification = new apn.Notification();
@@ -967,7 +968,7 @@
if (platformDetails.codeVersion && platformDetails.codeVersion > 198) {
notification.mutableContent = true;
}
- if (collapseKey && canDecryptAllNotifTypes) {
+ if (collapseKey && (canDecryptAllIOSNotifs || canDecryptMacOSNotifs)) {
notification.payload.collapseID = collapseKey;
} else if (collapseKey) {
notification.collapseId = collapseKey;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 8:02 AM (18 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2560013
Default Alt Text
D10188.id34277.diff (2 KB)
Attached To
Mode
D10188: Put collapse key in encrypted MacOS notification payload
Attached
Detach File
Event Timeline
Log In to Comment