mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-05-25 10:32: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:flutter/material.dart';
|
||||||
import 'package:twonly/locator.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_disabled.comp.dart';
|
||||||
import 'package:twonly/src/visual/views/settings/privacy/user_discovery/components/user_discovery_enabled.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) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('Freunde finden'),
|
title: Text(context.lang.userDiscoverySettingsTitle),
|
||||||
),
|
),
|
||||||
body: StreamBuilder<void>(
|
body: StreamBuilder<void>(
|
||||||
stream: userService.onUserUpdated,
|
stream: userService.onUserUpdated,
|
||||||
|
|
|
||||||
|
|
@ -274,11 +274,16 @@ impl<Store: UserDiscoveryStore, Utils: UserDiscoveryUtils> UserDiscovery<Store,
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Some(uda) = message.user_discovery_announcement {
|
if let Some(uda) = message.user_discovery_announcement {
|
||||||
self.handle_user_discovery_announcement(contact_id, uda)
|
if let Err(err) = self
|
||||||
.await?;
|
.handle_user_discovery_announcement(contact_id, uda)
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
tracing::warn!("Ignoring: {err}");
|
||||||
|
}
|
||||||
} else if let Some(udp) = message.user_discovery_promotion {
|
} else if let Some(udp) = message.user_discovery_promotion {
|
||||||
self.handle_user_discovery_promotion(contact_id, udp)
|
if let Err(err) = self.handle_user_discovery_promotion(contact_id, udp).await {
|
||||||
.await?;
|
tracing::warn!("Ignoring: {err}");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
tracing::warn!("Got unknown user discovery messaging. Ignoring it.");
|
tracing::warn!("Got unknown user discovery messaging. Ignoring it.");
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -476,6 +481,11 @@ impl<Store: UserDiscoveryStore, Utils: UserDiscoveryUtils> UserDiscovery<Store,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
tracing::debug!("Received a new UDP with public_id = {}.", &udp.public_id);
|
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
|
self.store
|
||||||
.store_other_promotion(OtherPromotion {
|
.store_other_promotion(OtherPromotion {
|
||||||
from_contact_id,
|
from_contact_id,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue