From 8621dde5a9696d2c3aa6775c7a7d15fe5961856b Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sat, 15 Jan 2022 12:14:23 +0100 Subject: [PATCH] chore: Display story privacy warning --- assets/l10n/intl_en.arb | 4 +++- lib/pages/add_story/invite_story_page.dart | 11 ++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb index 89d3e68c..c484dd83 100644 --- a/assets/l10n/intl_en.arb +++ b/assets/l10n/intl_en.arb @@ -2692,5 +2692,7 @@ }, "whoCanSeeMyStoriesDesc": "Please note that people can see and contact each other in your story.", "whatIsGoingOn": "What is going on?", - "addDescription": "Add description" + "addDescription": "Add description", + "storyPrivacyWarning": "Please note that people can see and contact each other in your story. Your stories will be visible for 24 hours but there is no guarantee that they will be deleted from all devices and servers.", + "iUnderstand": "Ich verstehe" } diff --git a/lib/pages/add_story/invite_story_page.dart b/lib/pages/add_story/invite_story_page.dart index ae6d067f..8f2e550d 100644 --- a/lib/pages/add_story/invite_story_page.dart +++ b/lib/pages/add_story/invite_story_page.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; +import 'package:adaptive_dialog/adaptive_dialog.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; import 'package:future_loading_dialog/future_loading_dialog.dart'; import 'package:matrix/matrix.dart'; @@ -27,6 +28,13 @@ class _InviteStoryPageState extends State { final Set _invite = {}; void _inviteAction() async { + final confirmed = await showOkCancelAlertDialog( + context: context, + message: L10n.of(context)!.storyPrivacyWarning, + okLabel: L10n.of(context)!.iUnderstand, + cancelLabel: L10n.of(context)!.cancel, + ); + if (confirmed != OkCancelResult.ok) return; final result = await showFutureLoadingDialog( context: context, future: () async { @@ -62,9 +70,6 @@ class _InviteStoryPageState extends State { .client .getUndecidedContactsForStories(widget.storiesRoom) .then((contacts) { - if (contacts.length < 20) { - _invite.addAll(contacts.map((u) => u.id)); - } return contacts; }); return Scaffold(