add bundle keys for one-one conversation

Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
sowjanyakch 2024-10-25 17:49:54 +02:00 committed by Marcel Hibbe
parent ca0533a686
commit 9537a8d9d3
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B
3 changed files with 8 additions and 0 deletions

View File

@ -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_INTERNAL_USER_ID
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_IS_BREAKOUT_ROOM 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_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_RECORDING_STATE
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_TOKEN import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_TOKEN
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_START_CALL_AFTER_ROOM_SWITCH 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, BundleKeys.KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_AUDIO,
participantPermissions.canPublishAudio() participantPermissions.canPublishAudio()
) )
bundle.putBoolean(KEY_IS_ROOM_ONE_TO_ONE, ConversationUtils.isOneToOne(it))
bundle.putBoolean( bundle.putBoolean(
BundleKeys.KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_VIDEO, BundleKeys.KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_VIDEO,
participantPermissions.canPublishVideo() participantPermissions.canPublishVideo()

View File

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

View File

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