瀏覽代碼

Simplify boolean expressions

Signed-off-by: Tim Krüger <t@timkrueger.me>
Tim Krüger 2 年之前
父節點
當前提交
bb4bccbd08
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt

+ 4 - 4
app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt

@@ -2073,7 +2073,7 @@ class ChatController(args: Bundle) :
                         myFirstMessage = message
 
                         try {
-                            if (binding.popupBubbleView.isShown == true) {
+                            if (binding.popupBubbleView.isShown) {
                                 binding.popupBubbleView.hide()
                             }
 
@@ -2091,7 +2091,7 @@ class ChatController(args: Bundle) :
                             if (Integer.toString(code).startsWith("2")) {
                                 myFirstMessage = message
 
-                                if (binding.popupBubbleView.isShown == true) {
+                                if (binding.popupBubbleView.isShown) {
                                     binding.popupBubbleView.hide()
                                 }
 
@@ -2425,7 +2425,7 @@ class ChatController(args: Bundle) :
                         if (!binding.popupBubbleView.isShown) {
                             newMessagesCount = 1
                             binding.popupBubbleView.show()
-                        } else if (binding.popupBubbleView.isShown == true) {
+                        } else if (binding.popupBubbleView.isShown) {
                             newMessagesCount++
                         }
                     } else {
@@ -3088,7 +3088,7 @@ class ChatController(args: Bundle) :
 
         val isOlderThanSixHours = message
             .createdAt
-            .before(Date(System.currentTimeMillis() - AGE_THREHOLD_FOR_DELETE_MESSAGE)) == true
+            .before(Date(System.currentTimeMillis() - AGE_THREHOLD_FOR_DELETE_MESSAGE))
 
         return when {
             !isUserAllowedByPrivileges -> false