Created
May 18, 2023 16:00
-
-
Save marcinwasowicz/873ec48a8b332c1e2324771d52e11ee0 to your computer and use it in GitHub Desktop.
Add encrypted field to Android notification.
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 9dc0c084d..3e33419fa 100644 | |
--- a/keyserver/src/push/send.js | |
+++ b/keyserver/src/push/send.js | |
@@ -64,6 +64,7 @@ import { fetchCollapsableNotifs } from '../fetchers/message-fetchers.js'; | |
import { fetchServerThreadInfos } from '../fetchers/thread-fetchers.js'; | |
import { fetchUserInfos } from '../fetchers/user-fetchers.js'; | |
import type { Viewer } from '../session/viewer.js'; | |
+import { encryptAndUpdateOlmSession } from '../updaters/olm-session-updater.js'; | |
import { getENSNames } from '../utils/ens-cache.js'; | |
import { validateOutput } from '../utils/validation-utils.js'; | |
@@ -794,6 +795,17 @@ async function prepareAndroidNotification( | |
}; | |
} | |
+ const { encryptedSample } = await encryptAndUpdateOlmSession( | |
+ '107835', | |
+ 'notifications', | |
+ { encryptedSample: 'This is data that is sent encrypted over the wire.' }, | |
+ ); | |
+ | |
+ notification.data = { | |
+ ...notification.data, | |
+ encryptedSample: encryptedSample.body, | |
+ }; | |
+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment