feat(contacts): обмен номером телефона по NFC/BLE

This commit is contained in:
klockky
2026-06-21 12:26:01 +00:00
parent 2f3b280fa4
commit ad04225a62
6 changed files with 65 additions and 32 deletions
+6 -2
View File
@@ -60,8 +60,9 @@ class ContactsModule {
static Future<CachedContact?> addContact(
Api api,
int id,
String firstName,
) async {
String firstName, {
int phone = 0,
}) async {
final resp = await api.sendRequest(Opcode.contactUpdate, {
'action': 'ADD',
'contactId': id,
@@ -92,6 +93,9 @@ class ContactsModule {
};
if (row == null) return null;
if (phone > 0 && ((row['phone'] as int?) ?? 0) == 0) {
row['phone'] = phone;
}
await AppDatabase.saveContacts([row]);
if (contact != null) _primeContactCache(contact);
revision.value++;