Update Lib Cwtch, Allow Deleting P2P contacts, Formatting

pull/355/head
Sarah Jamie Lewis 8 months ago
parent b280765631
commit 5b5fe586e8
  1. 2
      LIBCWTCH-GO-MACOS.version
  2. 2
      LIBCWTCH-GO.version
  3. 29
      lib/views/peersettingsview.dart
  4. 3
      lib/widgets/messagerow.dart

@ -1 +1 @@
2022-02-04-16-57-v1.5.4-28-g4e4e331
2022-02-07-17-39-v1.5.4-31-g17acc3b

@ -1 +1 @@
2022-02-04-21-58-v1.5.4-28-g4e4e331
2022-02-07-22-31-v1.5.4-31-g17acc3b

@ -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<PeerSettingsView> {
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<PeerSettingsView> {
child: Text(AppLocalizations.of(context)!.yesLeave),
onPressed: () {
var profileOnion = Provider.of<ContactInfoState>(context, listen: false).profileOnion;
var handle = Provider.of<ContactInfoState>(context, listen: false).identifier;
var identifier = Provider.of<ContactInfoState>(context, listen: false).identifier;
// locally update cache...
Provider.of<ContactInfoState>(context, listen: false).isArchived = true;
Provider.of<FlwtchState>(context, listen: false).cwtch.DeleteContact(profileOnion, handle);
Provider.of<ProfileInfoState>(context, listen: false).contactList.removeContact(identifier);
Provider.of<FlwtchState>(context, listen: false).cwtch.DeleteContact(profileOnion, identifier);
Future.delayed(Duration(milliseconds: 500), () {
Provider.of<AppState>(context, listen: false).selectedConversation = null;
Navigator.of(context).popUntil((route) => route.settings.name == "conversations"); // dismiss dialog

@ -156,8 +156,7 @@ class MessageRowState extends State<MessageRow> with SingleTickerProviderStateMi
String imagePath = Provider.of<MessageMetadata>(context).senderImage!;
if (sender != null) {
imagePath =
Provider.of<Settings>(context).isExperimentEnabled(ImagePreviewsExperiment) ? sender.imagePath : sender.defaultImagePath;
imagePath = Provider.of<Settings>(context).isExperimentEnabled(ImagePreviewsExperiment) ? sender.imagePath : sender.defaultImagePath;
}
Widget wdgPortrait = GestureDetector(
onTap: !isGroup

Loading…
Cancel
Save