mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 11:39:42 +01:00
set bundle keys in CallNotificationActivity
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
parent
dff22845eb
commit
e5789c0cf6
@ -112,13 +112,12 @@ import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_CONVERSATION_PASSWORD
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_FROM_NOTIFICATION_START_CALL
|
||||
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_GROUP
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_IS_ROOM_ONE_TO_ONE
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_MODIFIED_BASE_URL
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_AUDIO
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_VIDEO
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_RECORDING_STATE
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_ID
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_ONE_TO_ONE
|
||||
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_SWITCH_TO_ROOM
|
||||
@ -385,8 +384,7 @@ class CallActivity : CallBaseActivity() {
|
||||
canPublishAudioStream = extras.getBoolean(KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_AUDIO)
|
||||
canPublishVideoStream = extras.getBoolean(KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_VIDEO)
|
||||
isModerator = extras.getBoolean(KEY_IS_MODERATOR, false)
|
||||
isOneToOneConversation = extras.getBoolean(KEY_IS_ROOM_ONE_TO_ONE, false)
|
||||
isGroupConversation = extras.getBoolean(KEY_IS_ROOM_GROUP, false)
|
||||
isOneToOneConversation = extras.getBoolean(KEY_ROOM_ONE_TO_ONE, false)
|
||||
|
||||
if (extras.containsKey(KEY_FROM_NOTIFICATION_START_CALL)) {
|
||||
isIncomingCallFromNotification = extras.getBoolean(KEY_FROM_NOTIFICATION_START_CALL)
|
||||
@ -676,31 +674,25 @@ class CallActivity : CallBaseActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
if (isGroupConversation) {
|
||||
binding!!.hangupButton.setOnClickListener {
|
||||
hangup(true, null)
|
||||
}
|
||||
}
|
||||
|
||||
if (isOneToOneConversation && isModerator) {
|
||||
binding!!.hangupButton.setOnClickListener {
|
||||
showPopupMenu()
|
||||
}
|
||||
}
|
||||
|
||||
if (isOneToOneConversation) {
|
||||
binding!!.hangupButton.setOnLongClickListener {
|
||||
hangup(true, null)
|
||||
true
|
||||
}
|
||||
binding!!.hangupButton.setOnClickListener {
|
||||
showPopupMenu()
|
||||
}
|
||||
|
||||
if (isModerator && isGroupConversation) {
|
||||
}else{
|
||||
if (isModerator) {
|
||||
binding!!.hangupButton.setOnLongClickListener {
|
||||
showPopupMenu()
|
||||
true
|
||||
}
|
||||
}
|
||||
binding!!.hangupButton.setOnClickListener {
|
||||
hangup(true, null)
|
||||
}
|
||||
}
|
||||
|
||||
binding!!.popupMenu.setOnClickListener {
|
||||
hangup(true, true)
|
||||
|
@ -36,6 +36,7 @@ import com.nextcloud.talk.utils.NotificationUtils
|
||||
import com.nextcloud.talk.utils.SpreedFeatures
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_CALL_VOICE_ONLY
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_ONE_TO_ONE
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_TOKEN
|
||||
import okhttp3.Cache
|
||||
import java.io.IOException
|
||||
@ -91,7 +92,7 @@ class CallNotificationActivity : CallBaseActivity() {
|
||||
notificationTimestamp = extras.getInt(BundleKeys.KEY_NOTIFICATION_TIMESTAMP)
|
||||
displayName = extras.getString(BundleKeys.KEY_CONVERSATION_DISPLAY_NAME, "")
|
||||
callFlag = extras.getInt(BundleKeys.KEY_CALL_FLAG)
|
||||
isOneToOneCall = extras.getBoolean(BundleKeys.KEY_ROOM_ONE_TO_ONE)
|
||||
isOneToOneCall = extras.getBoolean(KEY_ROOM_ONE_TO_ONE)
|
||||
conversationName = extras.getString(BundleKeys.KEY_CONVERSATION_NAME, "")
|
||||
internalUserId = extras.getLong(BundleKeys.KEY_INTERNAL_USER_ID)
|
||||
}
|
||||
@ -175,6 +176,7 @@ class CallNotificationActivity : CallBaseActivity() {
|
||||
binding!!.callAnswerVoiceOnlyView.setOnClickListener {
|
||||
Log.d(TAG, "accept call (voice only)")
|
||||
intent.putExtra(KEY_CALL_VOICE_ONLY, true)
|
||||
intent.putExtra(KEY_ROOM_ONE_TO_ONE,isOneToOneCall)
|
||||
proceedToCall()
|
||||
}
|
||||
binding!!.callAnswerCameraView.setOnClickListener {
|
||||
@ -192,6 +194,7 @@ class CallNotificationActivity : CallBaseActivity() {
|
||||
|
||||
private fun proceedToCall() {
|
||||
val callIntent = Intent(this, CallActivity::class.java)
|
||||
intent.putExtra(KEY_ROOM_ONE_TO_ONE,isOneToOneCall)
|
||||
callIntent.putExtras(intent.extras!!)
|
||||
startActivity(callIntent)
|
||||
}
|
||||
|
@ -167,8 +167,6 @@ 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_GROUP
|
||||
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
|
||||
@ -3074,8 +3072,7 @@ class ChatActivity :
|
||||
BundleKeys.KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_AUDIO,
|
||||
participantPermissions.canPublishAudio()
|
||||
)
|
||||
bundle.putBoolean(KEY_IS_ROOM_ONE_TO_ONE, ConversationUtils.isOneToOneConversation(it))
|
||||
bundle.putBoolean(KEY_IS_ROOM_GROUP, ConversationUtils.isGroupConversation(it))
|
||||
bundle.putBoolean(BundleKeys.KEY_ROOM_ONE_TO_ONE, isOneToOneConversation())
|
||||
bundle.putBoolean(
|
||||
BundleKeys.KEY_PARTICIPANT_PERMISSION_CAN_PUBLISH_VIDEO,
|
||||
participantPermissions.canPublishVideo()
|
||||
|
@ -220,6 +220,7 @@ class NotificationWorker(context: Context, workerParams: WorkerParameters) : Wor
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun handleCallPushMessage() {
|
||||
val userBeingCalled = userManager.getUserWithId(signatureVerification.user!!.id!!).blockingGet()
|
||||
|
||||
@ -231,7 +232,7 @@ class NotificationWorker(context: Context, workerParams: WorkerParameters) : Wor
|
||||
bundle.putLong(KEY_INTERNAL_USER_ID, signatureVerification.user!!.id!!)
|
||||
bundle.putBoolean(KEY_FROM_NOTIFICATION_START_CALL, true)
|
||||
|
||||
val isOneToOneCall = conversation.type === ConversationEnums.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL
|
||||
val isOneToOneCall = conversation.type == ConversationEnums.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL
|
||||
|
||||
bundle.putBoolean(KEY_ROOM_ONE_TO_ONE, isOneToOneCall) // ggf change in Activity? not necessary????
|
||||
bundle.putString(BundleKeys.KEY_CONVERSATION_NAME, conversation.name)
|
||||
|
@ -24,14 +24,6 @@ object ConversationUtils {
|
||||
Participant.ParticipantType.USER_FOLLOWING_LINK == conversation.participantType
|
||||
}
|
||||
|
||||
fun isOneToOneConversation(conversation: ConversationModel): Boolean {
|
||||
return ConversationEnums.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL == conversation.type
|
||||
}
|
||||
|
||||
fun isGroupConversation(conversation: ConversationModel): Boolean {
|
||||
return ConversationEnums.ConversationType.ROOM_GROUP_CALL == conversation.type
|
||||
}
|
||||
|
||||
fun isParticipantOwnerOrModerator(conversation: ConversationModel): Boolean {
|
||||
return Participant.ParticipantType.OWNER == conversation.participantType ||
|
||||
Participant.ParticipantType.GUEST_MODERATOR == conversation.participantType ||
|
||||
|
@ -80,6 +80,4 @@ 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"
|
||||
const val KEY_IS_ROOM_GROUP: String = "KEY_IS_ROOM_GROUP"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user