Browse Source

add bundle keys for one-one conversation

Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
sowjanyakch 8 tháng trước cách đây
mục cha
commit
9537a8d9d3

+ 2 - 0
app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt

@@ -167,6 +167,7 @@ import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_FILE_PATHS
 import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_INTERNAL_USER_ID
 import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_IS_BREAKOUT_ROOM
 import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_IS_MODERATOR
+import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_IS_ROOM_ONE_TO_ONE
 import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_RECORDING_STATE
 import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_TOKEN
 import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_START_CALL_AFTER_ROOM_SWITCH
@@ -3072,6 +3073,7 @@ class ChatActivity :
                 BundleKeys.KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_AUDIO,
                 participantPermissions.canPublishAudio()
             )
+            bundle.putBoolean(KEY_IS_ROOM_ONE_TO_ONE, ConversationUtils.isOneToOne(it))
             bundle.putBoolean(
                 BundleKeys.KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_VIDEO,
                 participantPermissions.canPublishVideo()

+ 5 - 0
app/src/main/java/com/nextcloud/talk/utils/ConversationUtils.kt

@@ -24,6 +24,10 @@ object ConversationUtils {
             Participant.ParticipantType.USER_FOLLOWING_LINK == conversation.participantType
     }
 
+    fun isOneToOne(conversation:ConversationModel):Boolean{
+        return ConversationEnums.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL == conversation.type
+    }
+
     fun isParticipantOwnerOrModerator(conversation: ConversationModel): Boolean {
         return Participant.ParticipantType.OWNER == conversation.participantType ||
             Participant.ParticipantType.GUEST_MODERATOR == conversation.participantType ||
@@ -59,4 +63,5 @@ object ConversationUtils {
         return currentConversation != null &&
             currentConversation.type == ConversationEnums.ConversationType.NOTE_TO_SELF
     }
+
 }

+ 1 - 0
app/src/main/java/com/nextcloud/talk/utils/bundle/BundleKeys.kt

@@ -80,4 +80,5 @@ object BundleKeys {
     const val KEY_CREDENTIALS: String = "KEY_CREDENTIALS"
     const val KEY_FIELD_MAP: String = "KEY_FIELD_MAP"
     const val KEY_CHAT_URL: String = "KEY_CHAT_URL"
+    const val KEY_IS_ROOM_ONE_TO_ONE : String = "KEY_IS_ROOM_ONE_TO_ONE"
 }