adapt to java->kotlin changes regarding null-ability

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2022-03-07 09:55:30 +01:00
parent 15e875f974
commit 8e11f21233
No known key found for this signature in database
GPG Key ID: 6CADC7E3523C308B
3 changed files with 5 additions and 5 deletions

View File

@ -178,7 +178,7 @@ class MagicFirebaseMessagingService : FirebaseMessagingService() {
} else if (deleteAll) { } else if (deleteAll) {
cancelAllNotificationsForAccount(applicationContext, signatureVerification!!.userEntity) cancelAllNotificationsForAccount(applicationContext, signatureVerification!!.userEntity)
} else if (deleteMultiple) { } else if (deleteMultiple) {
notificationIds.forEach { notificationIds!!.forEach {
cancelExistingNotificationWithId( cancelExistingNotificationWithId(
applicationContext, applicationContext,
signatureVerification!!.userEntity, signatureVerification!!.userEntity,

View File

@ -35,7 +35,7 @@ data class DecryptedPushMessage(
var type: String?, var type: String?,
@JsonField(name = ["subject"]) @JsonField(name = ["subject"])
var subject: String?, var subject: String,
@JsonField(name = ["id"]) @JsonField(name = ["id"])
var id: String?, var id: String?,
@ -62,10 +62,10 @@ data class DecryptedPushMessage(
var text: String?, var text: String?,
@JsonIgnore @JsonIgnore
var timestamp: Long? var timestamp: Long
) : Parcelable { ) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' // 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 { override fun equals(other: Any?): Boolean {
if (this === other) return true if (this === other) return true

View File

@ -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 && if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && conversationUser.id != -1L &&
context != null context != null
) { ) {