Work on Blocked screen
This commit is contained in:
@@ -457,6 +457,8 @@ class BaresipService: Service() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Blocked.restore()
|
||||||
|
|
||||||
val recordings = File(filesDir, "recordings")
|
val recordings = File(filesDir, "recordings")
|
||||||
|
|
||||||
val restored = File(filesPath, "restored")
|
val restored = File(filesPath, "restored")
|
||||||
@@ -866,7 +868,14 @@ class BaresipService: Service() {
|
|||||||
Api.sip_treply(callp, 486, "Busy Here")
|
Api.sip_treply(callp, 486, "Busy Here")
|
||||||
Api.bevent_stop(bevent)
|
Api.bevent_stop(bevent)
|
||||||
toast(toastMsg)
|
toast(toastMsg)
|
||||||
if (!blockUnknown) {
|
if (blockUnknown)
|
||||||
|
Blocked(
|
||||||
|
ua.account.aor,
|
||||||
|
peerUri,
|
||||||
|
"invite",
|
||||||
|
GregorianCalendar().timeInMillis
|
||||||
|
).add()
|
||||||
|
else {
|
||||||
val name = "callwaiting_$toneCountry"
|
val name = "callwaiting_$toneCountry"
|
||||||
val resourceId = applicationContext.resources.getIdentifier(
|
val resourceId = applicationContext.resources.getIdentifier(
|
||||||
name,
|
name,
|
||||||
@@ -1872,6 +1881,7 @@ class BaresipService: Service() {
|
|||||||
val baresipContacts = mutableStateOf(emptyList<Contact.BaresipContact>())
|
val baresipContacts = mutableStateOf(emptyList<Contact.BaresipContact>())
|
||||||
val androidContacts = mutableStateOf(emptyList<Contact.AndroidContact>())
|
val androidContacts = mutableStateOf(emptyList<Contact.AndroidContact>())
|
||||||
val contactNames = mutableStateOf(emptyList<String>())
|
val contactNames = mutableStateOf(emptyList<String>())
|
||||||
|
|
||||||
val darkTheme = mutableStateOf(false)
|
val darkTheme = mutableStateOf(false)
|
||||||
val dynamicColors = mutableStateOf(false)
|
val dynamicColors = mutableStateOf(false)
|
||||||
var messages by mutableStateOf(emptyList<Message>())
|
var messages by mutableStateOf(emptyList<Message>())
|
||||||
@@ -1883,6 +1893,8 @@ class BaresipService: Service() {
|
|||||||
val calls = ArrayList<Call>()
|
val calls = ArrayList<Call>()
|
||||||
var callHistory = ArrayList<CallHistoryNew>()
|
var callHistory = ArrayList<CallHistoryNew>()
|
||||||
|
|
||||||
|
var blocked = ArrayList<Blocked>()
|
||||||
|
|
||||||
var contactsMode = "baresip"
|
var contactsMode = "baresip"
|
||||||
var addressFamily = ""
|
var addressFamily = ""
|
||||||
var dnsServers = listOf<InetAddress>()
|
var dnsServers = listOf<InetAddress>()
|
||||||
|
|||||||
@@ -155,6 +155,7 @@ private fun TopAppBar(navController: NavController, account: Account, callHistor
|
|||||||
val delete = stringResource(R.string.delete)
|
val delete = stringResource(R.string.delete)
|
||||||
val disable = stringResource(R.string.disable_history)
|
val disable = stringResource(R.string.disable_history)
|
||||||
val enable = stringResource(R.string.enable_history)
|
val enable = stringResource(R.string.enable_history)
|
||||||
|
val blocked = stringResource(R.string.blocked)
|
||||||
|
|
||||||
val showDialog = remember { mutableStateOf(false) }
|
val showDialog = remember { mutableStateOf(false) }
|
||||||
val positiveAction = remember { mutableStateOf({}) }
|
val positiveAction = remember { mutableStateOf({}) }
|
||||||
@@ -207,7 +208,7 @@ private fun TopAppBar(navController: NavController, account: Account, callHistor
|
|||||||
CustomElements.DropdownMenu(
|
CustomElements.DropdownMenu(
|
||||||
expanded,
|
expanded,
|
||||||
{ expanded = false },
|
{ expanded = false },
|
||||||
listOf(delete, if (account.callHistory) disable else enable),
|
if (account.callHistory) listOf(delete, disable, blocked) else listOf(enable),
|
||||||
onItemClick = { selectedItem ->
|
onItemClick = { selectedItem ->
|
||||||
expanded = false
|
expanded = false
|
||||||
when (selectedItem) {
|
when (selectedItem) {
|
||||||
@@ -222,6 +223,9 @@ private fun TopAppBar(navController: NavController, account: Account, callHistor
|
|||||||
account.callHistory = !account.callHistory
|
account.callHistory = !account.callHistory
|
||||||
Account.saveAccounts()
|
Account.saveAccounts()
|
||||||
}
|
}
|
||||||
|
blocked -> {
|
||||||
|
navController.navigate("blocked/${account.aor}")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -302,6 +302,7 @@ class MainActivity : ComponentActivity() {
|
|||||||
androidContactScreenRoute(navController, viewModel)
|
androidContactScreenRoute(navController, viewModel)
|
||||||
callsScreenRoute(navController, viewModel)
|
callsScreenRoute(navController, viewModel)
|
||||||
callDetailsScreenRoute(navController, viewModel)
|
callDetailsScreenRoute(navController, viewModel)
|
||||||
|
blockedScreenRoute(navController)
|
||||||
chatsScreenRoute(navController)
|
chatsScreenRoute(navController)
|
||||||
chatScreenRoute(navController, viewModel)
|
chatScreenRoute(navController, viewModel)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -281,6 +281,11 @@
|
|||||||
<string name="save_recording_question">Do you want to save this recording?</string>
|
<string name="save_recording_question">Do you want to save this recording?</string>
|
||||||
<string name="recording_saved">Recording saved</string>
|
<string name="recording_saved">Recording saved</string>
|
||||||
<string name="delete_call_alert">Do you want to delete this call from history?</string>
|
<string name="delete_call_alert">Do you want to delete this call from history?</string>
|
||||||
|
<!-- Blocked Activity -->
|
||||||
|
<string name="blocked">Blocked</string>
|
||||||
|
<string name="blocked_calls">Blocked Calls</string>
|
||||||
|
<string name="blocked_delete_alert">Do you want to delete blocked calls of \'%1$s\'\?</string>
|
||||||
|
<string name="blocked_contact_question">Do you want to add peer \'%1$s\' to contacts\?</string>
|
||||||
<!-- Chat Activity -->
|
<!-- Chat Activity -->
|
||||||
<string name="chat_with">Chat with %1$s</string>
|
<string name="chat_with">Chat with %1$s</string>
|
||||||
<string name="new_message">New message</string>
|
<string name="new_message">New message</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user