From 8e11f2123307ded1f95a48119f043d4255b7084f Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Mon, 7 Mar 2022 09:55:30 +0100 Subject: [PATCH] adapt to java->kotlin changes regarding null-ability Signed-off-by: Andy Scherzinger --- .../talk/services/firebase/MagicFirebaseMessagingService.kt | 2 +- .../nextcloud/talk/models/json/push/DecryptedPushMessage.kt | 6 +++--- .../main/java/com/nextcloud/talk/utils/NotificationUtils.kt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/gplay/java/com/nextcloud/talk/services/firebase/MagicFirebaseMessagingService.kt b/app/src/gplay/java/com/nextcloud/talk/services/firebase/MagicFirebaseMessagingService.kt index 0989bffaa..6c0e0bffe 100644 --- a/app/src/gplay/java/com/nextcloud/talk/services/firebase/MagicFirebaseMessagingService.kt +++ b/app/src/gplay/java/com/nextcloud/talk/services/firebase/MagicFirebaseMessagingService.kt @@ -178,7 +178,7 @@ class MagicFirebaseMessagingService : FirebaseMessagingService() { } else if (deleteAll) { cancelAllNotificationsForAccount(applicationContext, signatureVerification!!.userEntity) } else if (deleteMultiple) { - notificationIds.forEach { + notificationIds!!.forEach { cancelExistingNotificationWithId( applicationContext, signatureVerification!!.userEntity, diff --git a/app/src/main/java/com/nextcloud/talk/models/json/push/DecryptedPushMessage.kt b/app/src/main/java/com/nextcloud/talk/models/json/push/DecryptedPushMessage.kt index 8e9a54f14..a992f8bda 100644 --- a/app/src/main/java/com/nextcloud/talk/models/json/push/DecryptedPushMessage.kt +++ b/app/src/main/java/com/nextcloud/talk/models/json/push/DecryptedPushMessage.kt @@ -35,7 +35,7 @@ data class DecryptedPushMessage( var type: String?, @JsonField(name = ["subject"]) - var subject: String?, + var subject: String, @JsonField(name = ["id"]) var id: String?, @@ -62,10 +62,10 @@ data class DecryptedPushMessage( var text: String?, @JsonIgnore - var timestamp: Long? + var timestamp: Long ) : Parcelable { // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' - constructor() : this(null, null, null, null, 0, null, false, false, false, null, null, 0) + constructor() : this(null, null, "", null, 0, null, false, false, false, null, null, 0) override fun equals(other: Any?): Boolean { if (this === other) return true diff --git a/app/src/main/java/com/nextcloud/talk/utils/NotificationUtils.kt b/app/src/main/java/com/nextcloud/talk/utils/NotificationUtils.kt index 816848726..af769a3d7 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/NotificationUtils.kt +++ b/app/src/main/java/com/nextcloud/talk/utils/NotificationUtils.kt @@ -193,7 +193,7 @@ object NotificationUtils { } } - fun cancelExistingNotificationWithId(context: Context?, conversationUser: UserEntity, notificationId: Long) { + fun cancelExistingNotificationWithId(context: Context?, conversationUser: UserEntity, notificationId: Long?) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && conversationUser.id != -1L && context != null ) {