From 3dc22116d1b1970fc40e7e0274fe4d4c6f88fb42 Mon Sep 17 00:00:00 2001 From: "daniel.boehrs" Date: Thu, 14 May 2020 13:55:33 +0200 Subject: [PATCH] testing with in mem decryption --- lib/src/push/push_manager.dart | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/src/push/push_manager.dart b/lib/src/push/push_manager.dart index 1479d79a..0343843d 100644 --- a/lib/src/push/push_manager.dart +++ b/lib/src/push/push_manager.dart @@ -102,7 +102,15 @@ class PushManager { final pushChatMessage = _getPushChatMessage(decryptedContent); final fromEmail = pushChatMessage.fromEmail; final context = Context(); - final body = await context.decryptInMemory(pushChatMessage.contentType, pushChatMessage.content, fromEmail); + print("dboehrs starting decrypt for content $pushChatMessage"); + + var contentType = pushChatMessage.contentType; + if (contentType.isNullOrEmpty()) { + contentType = "text/plain; charset=utf-8"; + print("dboehrs manually setting content type to avoid null / empty value"); + } + final body = await context.decryptInMemory(contentType, pushChatMessage.content, fromEmail); + print("dboehrs decrypt done with result: $body"); _logger.info("Chat message received from: $fromEmail"); await _notificationManager.showNotificationFromPushAsync(fromEmail, body); }