mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 13:08:42 +00:00
fix #262
This commit is contained in:
parent
8979c44e53
commit
57058b3b13
5 changed files with 2 additions and 50 deletions
|
|
@ -10,7 +10,6 @@ import 'package:twonly/src/utils/misc.dart';
|
||||||
import 'package:twonly/src/views/components/flame.dart';
|
import 'package:twonly/src/views/components/flame.dart';
|
||||||
import 'package:twonly/src/views/components/headline.dart';
|
import 'package:twonly/src/views/components/headline.dart';
|
||||||
import 'package:twonly/src/views/components/initialsavatar.dart';
|
import 'package:twonly/src/views/components/initialsavatar.dart';
|
||||||
import 'package:twonly/src/views/components/verified_shield.dart';
|
|
||||||
|
|
||||||
class BestFriendsSelector extends StatelessWidget {
|
class BestFriendsSelector extends StatelessWidget {
|
||||||
const BestFriendsSelector({
|
const BestFriendsSelector({
|
||||||
|
|
@ -157,13 +156,6 @@ class UserCheckbox extends StatelessWidget {
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
if (isRealTwonly)
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(right: 2),
|
|
||||||
child: VerifiedShield(
|
|
||||||
user,
|
|
||||||
size: 12,
|
|
||||||
)),
|
|
||||||
Text(
|
Text(
|
||||||
displayName.length > 8
|
displayName.length > 8
|
||||||
? '${displayName.substring(0, 8)}...'
|
? '${displayName.substring(0, 8)}...'
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ import 'package:twonly/src/views/camera/image_editor/data/layer.dart';
|
||||||
import 'package:twonly/src/views/camera/image_editor/layers_viewer.dart';
|
import 'package:twonly/src/views/camera/image_editor/layers_viewer.dart';
|
||||||
import 'package:twonly/src/views/camera/image_editor/modules/all_emojis.dart';
|
import 'package:twonly/src/views/camera/image_editor/modules/all_emojis.dart';
|
||||||
import 'package:twonly/src/views/camera/share_image_view.dart';
|
import 'package:twonly/src/views/camera/share_image_view.dart';
|
||||||
import 'package:twonly/src/views/components/alert_dialog.dart';
|
|
||||||
import 'package:twonly/src/views/components/media_view_sizing.dart';
|
import 'package:twonly/src/views/components/media_view_sizing.dart';
|
||||||
import 'package:twonly/src/views/components/notification_badge.dart';
|
import 'package:twonly/src/views/components/notification_badge.dart';
|
||||||
import 'package:twonly/src/views/settings/subscription/subscription.view.dart';
|
import 'package:twonly/src/views/settings/subscription/subscription.view.dart';
|
||||||
|
|
@ -242,16 +241,6 @@ class _ShareImageEditorView extends State<ShareImageEditorView> {
|
||||||
? Theme.of(context).colorScheme.primary
|
? Theme.of(context).colorScheme.primary
|
||||||
: Colors.white,
|
: Colors.white,
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
if (widget.sendTo != null) {
|
|
||||||
if (!widget.sendTo!.verified) {
|
|
||||||
await showAlertDialog(
|
|
||||||
context,
|
|
||||||
context.lang.shareImageUserNotVerified,
|
|
||||||
context.lang.shareImageUserNotVerifiedDesc,
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_isRealTwonly = !_isRealTwonly;
|
_isRealTwonly = !_isRealTwonly;
|
||||||
if (_isRealTwonly) {
|
if (_isRealTwonly) {
|
||||||
maxShowTime = 12;
|
maxShowTime = 12;
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,6 @@ class _ShareImageView extends State<ShareImageView> {
|
||||||
bool sendingImage = false;
|
bool sendingImage = false;
|
||||||
bool hideArchivedUsers = true;
|
bool hideArchivedUsers = true;
|
||||||
final TextEditingController searchUserName = TextEditingController();
|
final TextEditingController searchUserName = TextEditingController();
|
||||||
bool showRealTwonlyWarning = false;
|
|
||||||
late StreamSubscription<List<Contact>> contactSub;
|
late StreamSubscription<List<Contact>> contactSub;
|
||||||
String lastQuery = '';
|
String lastQuery = '';
|
||||||
|
|
||||||
|
|
@ -150,15 +149,6 @@ class _ShareImageView extends State<ShareImageView> {
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateStatus(int userId, bool checked) {
|
void updateStatus(int userId, bool checked) {
|
||||||
if (widget.isRealTwonly) {
|
|
||||||
final user = contacts.firstWhere((x) => x.userId == userId);
|
|
||||||
if (!user.verified) {
|
|
||||||
showRealTwonlyWarning = true;
|
|
||||||
setState(() {});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
showRealTwonlyWarning = false;
|
|
||||||
widget.updateStatus(userId, checked);
|
widget.updateStatus(userId, checked);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
|
|
@ -175,13 +165,6 @@ class _ShareImageView extends State<ShareImageView> {
|
||||||
const EdgeInsets.only(bottom: 40, left: 10, top: 20, right: 10),
|
const EdgeInsets.only(bottom: 40, left: 10, top: 20, right: 10),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
if (showRealTwonlyWarning)
|
|
||||||
Text(
|
|
||||||
context.lang.shareImageAllTwonlyWarning,
|
|
||||||
style: const TextStyle(color: Colors.orange, fontSize: 13),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
|
||||||
if (showRealTwonlyWarning) const SizedBox(height: 10),
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||||
child: TextField(
|
child: TextField(
|
||||||
|
|
|
||||||
|
|
@ -297,7 +297,8 @@ class _ChatMessagesViewState extends State<ChatMessagesView> {
|
||||||
children: [
|
children: [
|
||||||
Text(getContactDisplayName(user)),
|
Text(getContactDisplayName(user)),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
VerifiedShield(key: verifyShieldKey, user),
|
if (user.verified)
|
||||||
|
VerifiedShield(key: verifyShieldKey, user)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ import 'package:twonly/src/database/twonly_database.dart';
|
||||||
import 'package:twonly/src/utils/misc.dart';
|
import 'package:twonly/src/utils/misc.dart';
|
||||||
import 'package:twonly/src/views/chats/chat_messages.view.dart';
|
import 'package:twonly/src/views/chats/chat_messages.view.dart';
|
||||||
import 'package:twonly/src/views/contact/contact.view.dart';
|
import 'package:twonly/src/views/contact/contact.view.dart';
|
||||||
import 'package:twonly/src/views/contact/contact_verify.view.dart';
|
|
||||||
|
|
||||||
class UserContextMenu extends StatefulWidget {
|
class UserContextMenu extends StatefulWidget {
|
||||||
const UserContextMenu({
|
const UserContextMenu({
|
||||||
|
|
@ -58,18 +57,6 @@ class _UserContextMenuState extends State<UserContextMenu> {
|
||||||
},
|
},
|
||||||
child: const FaIcon(FontAwesomeIcons.boxOpen),
|
child: const FaIcon(FontAwesomeIcons.boxOpen),
|
||||||
),
|
),
|
||||||
if (!widget.contact.verified)
|
|
||||||
PieAction(
|
|
||||||
tooltip: Text(context.lang.contextMenuVerifyUser),
|
|
||||||
onSelect: () {
|
|
||||||
Navigator.push(context, MaterialPageRoute(
|
|
||||||
builder: (context) {
|
|
||||||
return ContactVerifyView(widget.contact);
|
|
||||||
},
|
|
||||||
));
|
|
||||||
},
|
|
||||||
child: const Icon(Icons.gpp_maybe_rounded),
|
|
||||||
),
|
|
||||||
PieAction(
|
PieAction(
|
||||||
tooltip: Text(context.lang.contextMenuOpenChat),
|
tooltip: Text(context.lang.contextMenuOpenChat),
|
||||||
onSelect: () {
|
onSelect: () {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue