diff --git a/LIBCWTCH-GO-MACOS.version b/LIBCWTCH-GO-MACOS.version index 1f70ab7a..131da5bc 100644 --- a/LIBCWTCH-GO-MACOS.version +++ b/LIBCWTCH-GO-MACOS.version @@ -1 +1 @@ -2022-02-04-16-57-v1.5.4-28-g4e4e331 \ No newline at end of file +2022-02-07-17-39-v1.5.4-31-g17acc3b \ No newline at end of file diff --git a/LIBCWTCH-GO.version b/LIBCWTCH-GO.version index 61cc1a7b..ae1b1c97 100644 --- a/LIBCWTCH-GO.version +++ b/LIBCWTCH-GO.version @@ -1 +1 @@ -2022-02-04-21-58-v1.5.4-28-g4e4e331 \ No newline at end of file +2022-02-07-22-31-v1.5.4-31-g17acc3b \ No newline at end of file diff --git a/lib/views/peersettingsview.dart b/lib/views/peersettingsview.dart index 0ab762ee..0206c175 100644 --- a/lib/views/peersettingsview.dart +++ b/lib/views/peersettingsview.dart @@ -3,6 +3,7 @@ import 'dart:ui'; import 'package:cwtch/cwtch_icons_icons.dart'; import 'package:cwtch/models/appstate.dart'; import 'package:cwtch/models/contact.dart'; +import 'package:cwtch/models/profile.dart'; import 'package:flutter/services.dart'; import 'package:cwtch/widgets/buttontextfield.dart'; import 'package:cwtch/widgets/cwtchlabel.dart'; @@ -216,11 +217,29 @@ class _PeerSettingsViewState extends State { Navigator.of(context).popUntil((route) => route.settings.name == "conversations"); // dismiss dialog }); }, - icon: Icon(CwtchIcons.leave_chat), + icon: Icon(Icons.archive), label: Text(AppLocalizations.of(context)!.archiveConversation), )) + ]), + SizedBox( + height: 20, + ), + Row(crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.end, children: [ + Tooltip( + message: AppLocalizations.of(context)!.leaveConversation, + child: TextButton.icon( + onPressed: () { + showAlertDialog(context); + }, + style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Colors.transparent)), + icon: Icon(CwtchIcons.leave_group), + label: Text( + AppLocalizations.of(context)!.leaveConversation, + style: TextStyle(decoration: TextDecoration.underline), + ), + )) ]) - ]), + ]) ]))))); }); }); @@ -246,10 +265,10 @@ class _PeerSettingsViewState extends State { child: Text(AppLocalizations.of(context)!.yesLeave), onPressed: () { var profileOnion = Provider.of(context, listen: false).profileOnion; - var handle = Provider.of(context, listen: false).identifier; + var identifier = Provider.of(context, listen: false).identifier; // locally update cache... - Provider.of(context, listen: false).isArchived = true; - Provider.of(context, listen: false).cwtch.DeleteContact(profileOnion, handle); + Provider.of(context, listen: false).contactList.removeContact(identifier); + Provider.of(context, listen: false).cwtch.DeleteContact(profileOnion, identifier); Future.delayed(Duration(milliseconds: 500), () { Provider.of(context, listen: false).selectedConversation = null; Navigator.of(context).popUntil((route) => route.settings.name == "conversations"); // dismiss dialog diff --git a/lib/widgets/messagerow.dart b/lib/widgets/messagerow.dart index 0deb647b..ad92f840 100644 --- a/lib/widgets/messagerow.dart +++ b/lib/widgets/messagerow.dart @@ -156,8 +156,7 @@ class MessageRowState extends State with SingleTickerProviderStateMi String imagePath = Provider.of(context).senderImage!; if (sender != null) { - imagePath = - Provider.of(context).isExperimentEnabled(ImagePreviewsExperiment) ? sender.imagePath : sender.defaultImagePath; + imagePath = Provider.of(context).isExperimentEnabled(ImagePreviewsExperiment) ? sender.imagePath : sender.defaultImagePath; } Widget wdgPortrait = GestureDetector( onTap: !isGroup