Do not show chat button on mainscreen of mobile account
Call voicemail directly when voicemail button it touched on mainscreen of mobile account Properly handle canceling of mobile call
This commit is contained in:
@@ -1067,7 +1067,10 @@ private fun AccountContent(
|
|||||||
@Composable
|
@Composable
|
||||||
fun Voicemail() {
|
fun Voicemail() {
|
||||||
val voicemailUriTitle = stringResource(R.string.voicemail_uri)
|
val voicemailUriTitle = stringResource(R.string.voicemail_uri)
|
||||||
val voicemailUriHelp = stringResource(R.string.voicemain_uri_help)
|
val voicemailUriHelp = if (ua.account.isMobile)
|
||||||
|
stringResource(R.string.voicemain_tel_uri_help)
|
||||||
|
else
|
||||||
|
stringResource(R.string.voicemain_uri_help)
|
||||||
val vmUri by viewModel.vmUri.collectAsState()
|
val vmUri by viewModel.vmUri.collectAsState()
|
||||||
Row(
|
Row(
|
||||||
Modifier.fillMaxWidth().padding(end = 10.dp),
|
Modifier.fillMaxWidth().padding(end = 10.dp),
|
||||||
|
|||||||
@@ -1758,7 +1758,7 @@ class BaresipService: Service() {
|
|||||||
android.telecom.Call.STATE_RINGING -> "incoming"
|
android.telecom.Call.STATE_RINGING -> "incoming"
|
||||||
android.telecom.Call.STATE_DIALING, android.telecom.Call.STATE_CONNECTING -> "outgoing"
|
android.telecom.Call.STATE_DIALING, android.telecom.Call.STATE_CONNECTING -> "outgoing"
|
||||||
android.telecom.Call.STATE_ACTIVE -> "connected"
|
android.telecom.Call.STATE_ACTIVE -> "connected"
|
||||||
android.telecom.Call.STATE_DISCONNECTED -> "closed"
|
android.telecom.Call.STATE_DISCONNECTED, android.telecom.Call.STATE_DISCONNECTING -> "closed"
|
||||||
android.telecom.Call.STATE_HOLDING -> {
|
android.telecom.Call.STATE_HOLDING -> {
|
||||||
calls.find { it.callp == call.hashCode().toLong() }?.onhold = true
|
calls.find { it.callp == call.hashCode().toLong() }?.onhold = true
|
||||||
"connected"
|
"connected"
|
||||||
|
|||||||
@@ -740,6 +740,9 @@ private fun BottomBar(ctx: Context, viewModel: ViewModel, navController: NavCont
|
|||||||
val hasNewVoicemail = remember(aor, accountUpdate) {
|
val hasNewVoicemail = remember(aor, accountUpdate) {
|
||||||
if (aor.isNotEmpty()) (Account.ofAor(aor)?.vmNew ?: 0) > 0 else false
|
if (aor.isNotEmpty()) (Account.ofAor(aor)?.vmNew ?: 0) > 0 else false
|
||||||
}
|
}
|
||||||
|
val isMobile = remember(aor, accountUpdate) {
|
||||||
|
if (aor.isNotEmpty()) Account.ofAor(aor)?.isMobile ?: false else false
|
||||||
|
}
|
||||||
val hasUnreadMessages = remember(aor, accountUpdate) {
|
val hasUnreadMessages = remember(aor, accountUpdate) {
|
||||||
if (aor.isNotEmpty()) Account.ofAor(aor)?.unreadMessages ?: false else false
|
if (aor.isNotEmpty()) Account.ofAor(aor)?.unreadMessages ?: false else false
|
||||||
}
|
}
|
||||||
@@ -768,6 +771,12 @@ private fun BottomBar(ctx: Context, viewModel: ViewModel, navController: NavCont
|
|||||||
val ua = UserAgent.ofAor(aor)!!
|
val ua = UserAgent.ofAor(aor)!!
|
||||||
val acc = ua.account
|
val acc = ua.account
|
||||||
if (acc.vmUri.isNotEmpty()) {
|
if (acc.vmUri.isNotEmpty()) {
|
||||||
|
if (isMobile) {
|
||||||
|
val intent = Intent(ctx, MainActivity::class.java)
|
||||||
|
intent.putExtra("uap", ua.uap)
|
||||||
|
intent.putExtra("peer", acc.vmUri)
|
||||||
|
handleIntent(ctx, viewModel, intent, "call")
|
||||||
|
} else {
|
||||||
dialogTitle.value = ctx.getString(R.string.voicemail_messages)
|
dialogTitle.value = ctx.getString(R.string.voicemail_messages)
|
||||||
dialogMessage.value = acc.vmMessages(ctx)
|
dialogMessage.value = acc.vmMessages(ctx)
|
||||||
firstText.value = ctx.getString(R.string.cancel)
|
firstText.value = ctx.getString(R.string.cancel)
|
||||||
@@ -782,6 +791,7 @@ private fun BottomBar(ctx: Context, viewModel: ViewModel, navController: NavCont
|
|||||||
}
|
}
|
||||||
showDialog.value = true
|
showDialog.value = true
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
@@ -809,6 +819,7 @@ private fun BottomBar(ctx: Context, viewModel: ViewModel, navController: NavCont
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isMobile)
|
||||||
IconButton(
|
IconButton(
|
||||||
enabled = aor.isNotEmpty(),
|
enabled = aor.isNotEmpty(),
|
||||||
onClick = {
|
onClick = {
|
||||||
|
|||||||
@@ -206,9 +206,10 @@
|
|||||||
<string name="block_unknown">Block Unknown</string>
|
<string name="block_unknown">Block Unknown</string>
|
||||||
<string name="block_unknown_help">Block calls and messages from peers that are not found in contacts.</string>
|
<string name="block_unknown_help">Block calls and messages from peers that are not found in contacts.</string>
|
||||||
<string name="voicemail_uri">Voicemail URI</string>
|
<string name="voicemail_uri">Voicemail URI</string>
|
||||||
<string name="voicemain_uri_help">SIP or TEL URI for checking of voicemail messages. If left empty, voicemail
|
<string name="voicemain_uri_help">SIP URI for checking of voicemail messages. If left empty, voicemail
|
||||||
messages (Message Waiting Indications) are not subscribed to.
|
messages (Message Waiting Indications) are not subscribed to.
|
||||||
</string>
|
</string>
|
||||||
|
<string name="voicemain_tel_uri_help">TEL URI for checking of voicemail messages.</string>
|
||||||
<string name="country_code">Country Code</string>
|
<string name="country_code">Country Code</string>
|
||||||
<string name="country_code_help">E.164 country code of this account. If From URI userpart of
|
<string name="country_code_help">E.164 country code of this account. If From URI userpart of
|
||||||
incoming call or message contains a telephone number that does not start with \'+\' sign and if contact
|
incoming call or message contains a telephone number that does not start with \'+\' sign and if contact
|
||||||
|
|||||||
Reference in New Issue
Block a user