add setting to enable eviction of discovered contacts in settings

This commit is contained in:
ZIER committed 2026-08-03 09:04:36 +02:00
1 parent 98f6cf3745
commit 9db2307ea0
30 files changed
+260 -40

No files matched your search

+10 -4
View File
@@ -76,8 +76,7 @@ class Cyr2LatProfile {
class AppSettings {
static const Object _unset = Object();
static const String stadiaDemo =
'51bd0381-4685-4666-bae8-48940f6d77c0';
static const String stadiaDemo = '51bd0381-4685-4666-bae8-48940f6d77c0';
final bool clearPathOnMaxRetry;
final bool mapShowRepeaters;
@@ -116,6 +115,7 @@ class AppSettings {
final UnitSystem unitSystem;
final Set<String> mutedChannels;
final bool mapShowDiscoveryContacts;
final bool evictDiscoveredContactsEnabled;
final String tcpServerAddress;
final int tcpServerPort;
final bool jumpToOldestUnread;
@@ -137,8 +137,7 @@ class AppSettings {
return apiKey;
}
bool get usesstadiaDemo =>
effectiveMapTileApiKey == stadiaDemo;
bool get usesstadiaDemo => effectiveMapTileApiKey == stadiaDemo;
Map<String, String> get cyr2latCharMap {
final profile = cyr2latProfiles.firstWhere(
@@ -186,6 +185,7 @@ class AppSettings {
this.unitSystem = UnitSystem.metric,
Set<String>? mutedChannels,
this.mapShowDiscoveryContacts = true,
this.evictDiscoveredContactsEnabled = false,
this.tcpServerAddress = '',
this.tcpServerPort = 0,
this.jumpToOldestUnread = false,
@@ -253,6 +253,7 @@ class AppSettings {
'unit_system': unitSystem.value,
'muted_channels': mutedChannels.toList(),
'map_show_discovery_contacts': mapShowDiscoveryContacts,
'evict_discovered_contacts_enabled': evictDiscoveredContactsEnabled,
'tcp_server_address': tcpServerAddress,
'tcp_server_port': tcpServerPort,
'jump_to_oldest_unread': jumpToOldestUnread,
@@ -342,6 +343,8 @@ class AppSettings {
{},
mapShowDiscoveryContacts:
json['map_show_discovery_contacts'] as bool? ?? true,
evictDiscoveredContactsEnabled:
json['evict_discovered_contacts_enabled'] as bool? ?? false,
tcpServerAddress: json['tcp_server_address'] as String? ?? '',
tcpServerPort: json['tcp_server_port'] as int? ?? 0,
jumpToOldestUnread: json['jump_to_oldest_unread'] as bool? ?? false,
@@ -438,6 +441,7 @@ class AppSettings {
UnitSystem? unitSystem,
Set<String>? mutedChannels,
bool? mapShowDiscoveryContacts,
bool? evictDiscoveredContactsEnabled,
String? tcpServerAddress,
int? tcpServerPort,
bool? jumpToOldestUnread,
@@ -505,6 +509,8 @@ class AppSettings {
mutedChannels: mutedChannels ?? this.mutedChannels,
mapShowDiscoveryContacts:
mapShowDiscoveryContacts ?? this.mapShowDiscoveryContacts,
evictDiscoveredContactsEnabled:
evictDiscoveredContactsEnabled ?? this.evictDiscoveredContactsEnabled,
tcpServerAddress: tcpServerAddress ?? this.tcpServerAddress,
tcpServerPort: tcpServerPort ?? this.tcpServerPort,
jumpToOldestUnread: jumpToOldestUnread ?? this.jumpToOldestUnread,