Add opt-in network map uploads and online map view

- Opt-in upload of header-only packet records and repeater/room server
  adverts to map.meshcoreopen.org about once a minute; payloads, channel
  and DM hashes and transport codes are stripped on the phone, locations
  snapped to a ~2 km grid, install ID rotates daily
- One-time opt-in dialog on first radio connection; toggle and status in
  App settings
- Local / Online / Both switch on the map screen with online repeater
  hexagons, links, add-to-contacts and manage
- Node purchase banner on the connect screen (affiliate link, disclosed)
- Privacy policy and network map documentation
- Translations for all locales
This commit is contained in:
zjs81 committed 2026-10-11 21:54:16 -07:00
1 parent d30744aa31
commit bc14de586f
68 files changed
+6719 -76

No files matched your search

+22
View File
@@ -9,6 +9,10 @@ const String contactsAllGroupsValue = '__all__';
enum ChannelSortOption { manual, name, latestMessages, unread }
/// Which nodes the map draws: the radio's own contacts, the online network
/// map, or both.
enum MapSourceOption { local, online, both }
class UiViewStateService extends ChangeNotifier {
static const _keyContactsSelectedGroupName = 'ui_contacts_selected_group';
static const _keyContactsSortOption = 'ui_contacts_sort_option';
@@ -16,6 +20,7 @@ class UiViewStateService extends ChangeNotifier {
static const _keyContactsTypeFilter = 'ui_contacts_type_filter';
static const _keyChannelsSortOption = 'ui_channels_sort_option';
static const _keyChannelsSortIndexLegacy = 'ui_channels_sort_index';
static const _keyMapSource = 'ui_map_source';
String _contactsSelectedGroupName = contactsAllGroupsValue;
String _contactsSearchText = '';
@@ -26,6 +31,7 @@ class UiViewStateService extends ChangeNotifier {
String _channelsSearchText = '';
ChannelSortOption _channelsSortOption = ChannelSortOption.manual;
MapSourceOption _mapSource = MapSourceOption.local;
String get contactsSelectedGroupName => _contactsSelectedGroupName;
String get contactsSearchText => _contactsSearchText;
@@ -35,6 +41,7 @@ class UiViewStateService extends ChangeNotifier {
ContactTypeFilter get contactsTypeFilter => _contactsTypeFilter;
String get channelsSearchText => _channelsSearchText;
ChannelSortOption get channelsSortOption => _channelsSortOption;
MapSourceOption get mapSource => _mapSource;
Future<void> initialize() async {
final prefs = PrefsManager.instance;
@@ -63,6 +70,14 @@ class UiViewStateService extends ChangeNotifier {
);
}
final mapSourceStr = prefs.getString(_keyMapSource);
if (mapSourceStr != null) {
_mapSource = MapSourceOption.values.firstWhere(
(e) => e.name == mapSourceStr,
orElse: () => MapSourceOption.local,
);
}
final channelSortStr = prefs.getString(_keyChannelsSortOption);
if (channelSortStr != null) {
_channelsSortOption = ChannelSortOption.values.firstWhere(
@@ -151,4 +166,11 @@ class UiViewStateService extends ChangeNotifier {
PrefsManager.instance.setString(_keyChannelsSortOption, value.name),
);
}
void setMapSource(MapSourceOption value) {
if (_mapSource == value) return;
_mapSource = value;
notifyListeners();
unawaited(PrefsManager.instance.setString(_keyMapSource, value.name));
}
}