瀏覽代碼

adapt to java->kotlin changes regarding null-ability

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 3 年之前
父節點
當前提交
8e11f21233

+ 1 - 1
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,

+ 3 - 3
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

+ 1 - 1
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
         ) {