Browse Source

hide call notification setting for federated rooms

because right now it's response is http 406 as calls are not implemented for federation

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Marcel Hibbe 1 year ago
parent
commit
2cec1637e8

+ 10 - 3
app/src/main/java/com/nextcloud/talk/conversationinfo/ConversationInfoActivity.kt

@@ -199,7 +199,7 @@ class ConversationInfoActivity :
         if (databaseStorageModule == null) {
             databaseStorageModule = DatabaseStorageModule(conversationUser, conversationToken)
         }
-        setUpNotificationSettings(databaseStorageModule!!)
+
         binding.deleteConversationAction.setOnClickListener { showDeleteConversationDialog() }
         binding.leaveConversationAction.setOnClickListener { leaveConversation() }
         binding.clearConversationHistory.setOnClickListener { showClearHistoryDialog() }
@@ -690,6 +690,8 @@ class ConversationInfoActivity :
     private fun handleConversation() {
         val conversationCopy = conversation!!
 
+        setUpNotificationSettings(databaseStorageModule!!)
+
         if (CapabilitiesUtil.hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.RICH_OBJECT_LIST_MEDIA) &&
             conversationCopy.remoteServer.isNullOrEmpty()
         ) {
@@ -1347,8 +1349,13 @@ class ConversationInfoActivity :
         binding.notificationSettingsView.importantConversationSwitch.isChecked = module
             .getBoolean("important_conversation_switch", false)
 
-        binding.notificationSettingsView.callNotificationsSwitch.isChecked = module
-            .getBoolean("call_notifications_switch", true)
+        if (conversation!!.remoteServer.isNullOrEmpty()) {
+            binding.notificationSettingsView.notificationSettingsCallNotifications.visibility = VISIBLE
+            binding.notificationSettingsView.callNotificationsSwitch.isChecked = module
+                .getBoolean("call_notifications_switch", true)
+        } else {
+            binding.notificationSettingsView.notificationSettingsCallNotifications.visibility = GONE
+        }
     }
 
     companion object {