Fixed adding of new contact

This commit is contained in:
Juha Heinanen
2022-02-24 15:04:19 +02:00
parent 6c1a8c1f5c
commit aa4ae23dc6
2 changed files with 5 additions and 1 deletions
@@ -204,6 +204,10 @@ sealed class Contact {
BaresipService.contactUpdate.postValue(System.nanoTime()) BaresipService.contactUpdate.postValue(System.nanoTime())
} }
fun addBaresipContact(contact: BaresipContact) {
BaresipService.baresipContacts.add(contact)
}
fun removeBaresipContact(contact: BaresipContact) { fun removeBaresipContact(contact: BaresipContact) {
BaresipService.baresipContacts.remove(contact) BaresipService.baresipContacts.remove(contact)
saveBaresipContacts() saveBaresipContacts()
@@ -269,7 +269,7 @@ class ContactActivity : AppCompatActivity() {
addOrUpdateAndroidContact(this, contact) addOrUpdateAndroidContact(this, contact)
} else { } else {
if (newContact) if (newContact)
Contact.contacts().add(contact) Contact.addBaresipContact(contact)
Contact.saveBaresipContacts() Contact.saveBaresipContacts()
Contact.contactsUpdate() Contact.contactsUpdate()
} }