Skip to content

Commit d446f99

Browse files
Merge pull request #1118 from nextcloud/fix/neon/push-notification-decryption
2 parents c127cab + 39fc30e commit d446f99

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

packages/neon/neon/lib/src/models/push_notification.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ class PushNotification {
3838
/// Use [PushNotification.fromJson] when the [subject] is not encrypted.
3939
factory PushNotification.fromEncrypted(
4040
final Map<String, dynamic> json,
41+
final String accountID,
4142
final RSAPrivateKey privateKey,
4243
) {
4344
final subject = decryptPushNotificationSubject(privateKey, json[_subjectKey] as String);
4445

4546
return PushNotification(
46-
accountID: json[_accountIDKey] as String,
47+
accountID: accountID,
4748
priority: json[_priorityKey] as String,
4849
type: json[_typeKey] as String,
4950
subject: subject,

packages/neon/neon/lib/src/utils/push_utils.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ class PushUtils {
7979
final keypair = loadRSAKeypair();
8080
for (final message in Uri(query: utf8.decode(messages)).queryParameters.values) {
8181
final data = json.decode(message) as Map<String, dynamic>;
82-
final pushNotification = PushNotification.fromEncrypted(data, keypair.privateKey);
82+
final pushNotification = PushNotification.fromEncrypted(
83+
data,
84+
instance,
85+
keypair.privateKey,
86+
);
8387

8488
if (pushNotification.subject.delete ?? false) {
8589
await localNotificationsPlugin.cancel(_getNotificationID(instance, pushNotification));

0 commit comments

Comments
 (0)