This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/keyserver/src/push/send.js b/keyserver/src/push/send.js | |
index c75f2c248..44ea265e8 100644 | |
--- a/keyserver/src/push/send.js | |
+++ b/keyserver/src/push/send.js | |
@@ -361,15 +361,24 @@ async function sendPushNotif(input: { | |
}; | |
const deliveryPromise: Promise<PushResult> = (async () => { | |
- const targetedNotifications = await prepareWebNotification( | |
- { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/web/push-notif/service-worker.js b/web/push-notif/service-worker.js | |
index a03e36af4..4eeedaff7 100644 | |
--- a/web/push-notif/service-worker.js | |
+++ b/web/push-notif/service-worker.js | |
@@ -1,5 +1,5 @@ | |
// @flow | |
- | |
+import olm from '@commapp/olm'; | |
import localforage from 'localforage'; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::string NotificationsCryptoModule::prettyPrint() { | |
std::string picklingKey = NotificationsCryptoModule::getPicklingKey(); | |
crypto::Persist persist = this->statefulCryptoModule.storeAsB64(picklingKey); | |
folly::dynamic sessions = folly::dynamic::object; | |
for (auto &sessionKeyValuePair : persist.sessions) { | |
std::string targetUserID = sessionKeyValuePair.first; | |
crypto::OlmBuffer sessionData = sessionKeyValuePair.second; | |
sessions[targetUserID] = | |
std::string(sessionData.begin(), sessionData.end()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/keyserver/src/push/send.js b/keyserver/src/push/send.js | |
index 894dbf0a4..181c52db8 100644 | |
--- a/keyserver/src/push/send.js | |
+++ b/keyserver/src/push/send.js | |
@@ -912,14 +912,14 @@ async function prepareAndroidNotification( | |
dbID, | |
} = convertedData; | |
- const isTextNotification = newRawMessageInfos.every( | |
- newRawMessageInfo => newRawMessageInfo.type === messageTypes.TEXT, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/keyserver/src/push/utils.js b/keyserver/src/push/utils.js | |
index d9c9b2955..1be2e148f 100644 | |
--- a/keyserver/src/push/utils.js | |
+++ b/keyserver/src/push/utils.js | |
@@ -61,11 +61,14 @@ async function apnPush({ | |
} | |
invariant(apnProvider, `keyserver/secrets/${pushProfile}.json should exist`); | |
- const results = await Promise.all( | |
- targetedNotifications.map(({ notification, deviceToken }) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/keyserver/src/push/send.js b/keyserver/src/push/send.js | |
index 7c705a864..78fddfe24 100644 | |
--- a/keyserver/src/push/send.js | |
+++ b/keyserver/src/push/send.js | |
@@ -714,14 +714,14 @@ async function prepareAPNsNotification( | |
platformDetails, | |
} = convertedData; | |
- const isTextNotification = newRawMessageInfos.every( | |
- newRawMessageInfo => newRawMessageInfo.type === messageTypes.TEXT, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/native/ios/NotificationService/NotificationService.mm b/native/ios/NotificationService/NotificationService.mm | |
index be7a02838..c623e7ef2 100644 | |
--- a/native/ios/NotificationService/NotificationService.mm | |
+++ b/native/ios/NotificationService/NotificationService.mm | |
@@ -200,13 +200,17 @@ CFStringRef newMessageInfosDarwinNotification = | |
} | |
- (void)decryptBestAttemptContent { | |
- NSString *decryptedSerializedPayload = [self | |
- singleDecrypt:self.bestAttemptContent.userInfo[encryptedPayloadKey]]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -40,30 +40,17 @@ async function encryptIOSNotification( | |
}; | |
try { | |
- const unencryptedSerializedPayload = JSON.stringify(unencryptedPayload); | |
+ const { encryptedMessages: encryptedPayload, dbPersistConditionViolated } = | |
+ await encryptAndUpdateOlmSession( | |
+ cookieID, | |
+ 'notifications', | |
+ unencryptedPayload, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/native/android/app/src/main/java/app/comm/android/notifications/CommNotificationsHandler.java b/native/android/app/src/main/java/app/comm/android/notifications/CommNotificationsHandler.java | |
index c0b158d98..d15f8919f 100644 | |
--- a/native/android/app/src/main/java/app/comm/android/notifications/CommNotificationsHandler.java | |
+++ b/native/android/app/src/main/java/app/comm/android/notifications/CommNotificationsHandler.java | |
@@ -23,6 +23,7 @@ import app.comm.android.fbjni.GlobalDBSingleton; | |
import app.comm.android.fbjni.MessageOperationsUtilities; | |
import app.comm.android.fbjni.NetworkModule; | |
import app.comm.android.fbjni.NotificationsCryptoModule; | |
+import app.comm.android.fbjni.PlatformSpecificTools; | |
import app.comm.android.fbjni.ThreadOperations; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/keyserver/src/push/send.js b/keyserver/src/push/send.js | |
index dcea65c21..3c75fe9c9 100644 | |
--- a/keyserver/src/push/send.js | |
+++ b/keyserver/src/push/send.js | |
@@ -732,12 +732,37 @@ async function prepareAPNsNotification( | |
platformDetails.codeVersion > 222 | |
) { | |
const cookieIDs = devices.map(({ cookieID }) => cookieID); | |
- const [notifications, notificationsWithMessageInfos] = await Promise.all([ | |
- prepareEncryptedIOSNotifications(cookieIDs, notification), |