mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-05-25 02:12:13 +00:00
change handling of invalid data
This commit is contained in:
parent
94982ca253
commit
bcb2403059
2 changed files with 16 additions and 5 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:twonly/locator.dart';
|
||||
import 'package:twonly/src/utils/misc.dart';
|
||||
import 'package:twonly/src/visual/views/settings/privacy/user_discovery/components/user_discovery_disabled.comp.dart';
|
||||
import 'package:twonly/src/visual/views/settings/privacy/user_discovery/components/user_discovery_enabled.comp.dart';
|
||||
|
||||
|
|
@ -16,7 +17,7 @@ class _UserDiscoverySettingsViewState extends State<UserDiscoverySettingsView> {
|
|||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Freunde finden'),
|
||||
title: Text(context.lang.userDiscoverySettingsTitle),
|
||||
),
|
||||
body: StreamBuilder<void>(
|
||||
stream: userService.onUserUpdated,
|
||||
|
|
|
|||
|
|
@ -274,11 +274,16 @@ impl<Store: UserDiscoveryStore, Utils: UserDiscoveryUtils> UserDiscovery<Store,
|
|||
};
|
||||
|
||||
if let Some(uda) = message.user_discovery_announcement {
|
||||
self.handle_user_discovery_announcement(contact_id, uda)
|
||||
.await?;
|
||||
if let Err(err) = self
|
||||
.handle_user_discovery_announcement(contact_id, uda)
|
||||
.await
|
||||
{
|
||||
tracing::warn!("Ignoring: {err}");
|
||||
}
|
||||
} else if let Some(udp) = message.user_discovery_promotion {
|
||||
self.handle_user_discovery_promotion(contact_id, udp)
|
||||
.await?;
|
||||
if let Err(err) = self.handle_user_discovery_promotion(contact_id, udp).await {
|
||||
tracing::warn!("Ignoring: {err}");
|
||||
}
|
||||
} else {
|
||||
tracing::warn!("Got unknown user discovery messaging. Ignoring it.");
|
||||
continue;
|
||||
|
|
@ -476,6 +481,11 @@ impl<Store: UserDiscoveryStore, Utils: UserDiscoveryUtils> UserDiscovery<Store,
|
|||
) -> Result<()> {
|
||||
tracing::debug!("Received a new UDP with public_id = {}.", &udp.public_id);
|
||||
|
||||
if udp.announcement_share.is_empty() {
|
||||
tracing::info!("Got empty announcement share. Ignoring it..");
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
self.store
|
||||
.store_other_promotion(OtherPromotion {
|
||||
from_contact_id,
|
||||
|
|
|
|||
Loading…
Reference in a new issue