Cherry-Pick of first commit of PR #373

This commit is contained in:
ericz committed 2026-05-10 10:00:22 +02:00
1 parent e92a66ff28
commit 25c65bd2b1
47 files changed
+1475 -26

No files matched your search

+20
View File
@@ -368,6 +368,26 @@ class MeshCoreConnector extends ChangeNotifier {
return List.unmodifiable(_discoveredContacts);
}
String exportDiscoveredContactsJson() {
return _discoveryContactStore.exportContactsJson(_discoveredContacts);
}
Future<int> importDiscoveredContactsJson(String json) async {
final newCount = _discoveryContactStore.importContactsJson(
json: json,
existingContacts: _discoveredContacts,
knownContactKeys: _knownContactKeys,
);
if (newCount == 0 && _discoveredContacts.isEmpty) {
return 0;
}
await _persistDiscoveredContacts();
notifyListeners();
return newCount;
}
List<Channel> get channels => List.unmodifiable(_channels);
bool get isConnected => _state == MeshCoreConnectionState.connected;
bool get isLoadingContacts => _isLoadingContacts;