Merge pull request 'Upgrade Cwtch, Minor Formatting, Fix StopFileShare' (#716) from stable-blockers into trunk
continuous-integration/drone/push Build is passing Details

Reviewed-on: #716
Reviewed-by: Dan Ballard <dan@openprivacy.ca>
This commit is contained in:
Sarah Jamie Lewis 2023-09-06 21:25:15 +00:00
commit 05b1616473
10 changed files with 26 additions and 24 deletions

View File

@ -1 +1 @@
2023-08-22-14-06-v0.0.6 2023-08-31-11-56-v0.0.6-2-gf32ad74

View File

@ -74,7 +74,7 @@ Feature: Basic Profile Management
When I tap the "IconButton" widget with tooltip "Edit Profile Alice (Encrypted)" When I tap the "IconButton" widget with tooltip "Edit Profile Alice (Encrypted)"
Then I expect the text 'Display Name' to be present Then I expect the text 'Display Name' to be present
Then I fill the "displayNameFormElement" field with "Carol (Encrypted)" Then I fill the "displayNameFormElement" field with "Carol (Encrypted)"
And I tap the "button" widget with label "Save Profile" And I tap the widget that contains the text "Save Profile"
And I wait until the widget with type 'ProfileMgrView' is present And I wait until the widget with type 'ProfileMgrView' is present
Then I expect a "ProfileRow" widget with text "Carol (Encrypted)" Then I expect a "ProfileRow" widget with text "Carol (Encrypted)"
@ -90,7 +90,7 @@ Feature: Basic Profile Management
When I tap the "IconButton" widget with tooltip "Edit Profile Carol (Encrypted)" When I tap the "IconButton" widget with tooltip "Edit Profile Carol (Encrypted)"
Then I expect the text 'Display Name' to be present Then I expect the text 'Display Name' to be present
Then I fill the "currentPasswordFormElement" field with "password1" Then I fill the "currentPasswordFormElement" field with "password1"
When I tap the button that contains the text "Delete" And I tap the widget that contains the text "Delete"
Then I wait for 2 seconds Then I wait for 2 seconds
When I tap the "button" widget with label "Really Delete Profile" When I tap the "button" widget with label "Really Delete Profile"
And I wait until the widget with type 'ProfileMgrView' is present And I wait until the widget with type 'ProfileMgrView' is present

View File

@ -892,7 +892,7 @@ class CwtchFfi implements Cwtch {
@override @override
void StopSharing(String profile, String filekey) { void StopSharing(String profile, String filekey) {
var stopSharingC = library.lookup<NativeFunction<void_from_string_string_function>>("c_StopSharing"); var stopSharingC = library.lookup<NativeFunction<void_from_string_string_function>>("c_StopFileShare");
// ignore: non_constant_identifier_names // ignore: non_constant_identifier_names
final StopSharing = stopSharingC.asFunction<VoidFromStringStringFn>(); final StopSharing = stopSharingC.asFunction<VoidFromStringStringFn>();
final utf8profile = profile.toNativeUtf8(); final utf8profile = profile.toNativeUtf8();
@ -924,9 +924,6 @@ class CwtchFfi implements Cwtch {
malloc.free(u1); malloc.free(u1);
} }
@override @override
bool IsServersCompiled() { bool IsServersCompiled() {
return library.providesSymbol("c_LoadServers"); return library.providesSymbol("c_LoadServers");

View File

@ -365,7 +365,6 @@ class CwtchGomobile implements Cwtch {
cwtchPlatform.invokeMethod("DeleteServerInfo", {"ProfileOnion": profile, "handle": handle}); cwtchPlatform.invokeMethod("DeleteServerInfo", {"ProfileOnion": profile, "handle": handle});
} }
@override @override
void UpdateSettings(String json) { void UpdateSettings(String json) {
cwtchPlatform.invokeMethod("UpdateSettings", {"json": json}); cwtchPlatform.invokeMethod("UpdateSettings", {"json": json});

View File

@ -68,7 +68,6 @@ class ProfileInfoState extends ChangeNotifier {
this._contacts.addAll(contacts.map((contact) { this._contacts.addAll(contacts.map((contact) {
this._unreadMessages += contact["numUnread"] as int; this._unreadMessages += contact["numUnread"] as int;
return ContactInfoState(this.onion, contact["identifier"], contact["onion"], return ContactInfoState(this.onion, contact["identifier"], contact["onion"],
nickname: contact["name"], nickname: contact["name"],
localNickname: contact["attributes"]?["local.profile.name"] ?? "", // contact may not have a local name localNickname: contact["attributes"]?["local.profile.name"] ?? "", // contact may not have a local name

View File

@ -134,7 +134,7 @@ class Settings extends ChangeNotifier {
// Decide whether to enable Experiments // Decide whether to enable Experiments
var fontScale = settings["FontScaling"]; var fontScale = settings["FontScaling"];
if (fontScale == null) { if (fontScale == null) {
fontScale = 1.0; fontScale = 1.0;
} }
_fontScaling = double.parse(fontScale.toString()).clamp(0.5, 2.0); _fontScaling = double.parse(fontScale.toString()).clamp(0.5, 2.0);

View File

@ -51,7 +51,9 @@ class _FileSharingViewState extends State<FileSharingView> {
semanticChildCount: sharedFiles.length, semanticChildCount: sharedFiles.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
String filekey = sharedFiles[index]["FileKey"]; String filekey = sharedFiles[index]["FileKey"];
EnvironmentConfig.debugLog("$sharedFiles " + sharedFiles[index].toString()); // This makes the UI *very* slow when enabled. But can be useful for debugging
// Uncomment if necessary.
// EnvironmentConfig.debugLog("$sharedFiles " + sharedFiles[index].toString());
return SwitchListTile( return SwitchListTile(
title: Text(sharedFiles[index]["Path"]), title: Text(sharedFiles[index]["Path"]),
subtitle: Text(sharedFiles[index]["DateShared"]), subtitle: Text(sharedFiles[index]["DateShared"]),

View File

@ -217,12 +217,12 @@ class _PeerSettingsViewState extends State<PeerSettingsView> {
subtitle: Text(AppLocalizations.of(context)!.savePeerHistoryDescription), subtitle: Text(AppLocalizations.of(context)!.savePeerHistoryDescription),
leading: Icon(CwtchIcons.peer_history, color: settings.current().mainTextColor), leading: Icon(CwtchIcons.peer_history, color: settings.current().mainTextColor),
trailing: DropdownButton( trailing: DropdownButton(
value: (Provider.of<ContactInfoState>(context).savePeerHistory == "DefaultDeleteHistory" || value:
Provider.of<ContactInfoState>(context).savePeerHistory == "HistoryDefault") (Provider.of<ContactInfoState>(context).savePeerHistory == "DefaultDeleteHistory" || Provider.of<ContactInfoState>(context).savePeerHistory == "HistoryDefault")
? AppLocalizations.of(context)!.conversationNotificationPolicyDefault ? AppLocalizations.of(context)!.conversationNotificationPolicyDefault
: (Provider.of<ContactInfoState>(context).savePeerHistory == "SaveHistory" : (Provider.of<ContactInfoState>(context).savePeerHistory == "SaveHistory"
? AppLocalizations.of(context)!.savePeerHistory ? AppLocalizations.of(context)!.savePeerHistory
: AppLocalizations.of(context)!.dontSavePeerHistory), : AppLocalizations.of(context)!.dontSavePeerHistory),
onChanged: (newValue) { onChanged: (newValue) {
setState(() { setState(() {
// Set whether or not to dave the Contact History... // Set whether or not to dave the Contact History...
@ -234,7 +234,7 @@ class _PeerSettingsViewState extends State<PeerSettingsView> {
const HistoryDefault = "HistoryDefault"; const HistoryDefault = "HistoryDefault";
// NOTE: .savePeerHistory is used to show ephemeral warnings so it's state is important to update. // NOTE: .savePeerHistory is used to show ephemeral warnings so it's state is important to update.
if(newValue == AppLocalizations.of(context)!.conversationNotificationPolicyDefault) { if (newValue == AppLocalizations.of(context)!.conversationNotificationPolicyDefault) {
Provider.of<ContactInfoState>(context, listen: false).savePeerHistory = HistoryDefault; Provider.of<ContactInfoState>(context, listen: false).savePeerHistory = HistoryDefault;
Provider.of<FlwtchState>(context, listen: false).cwtch.SetConversationAttribute(profileOnion, identifier, SaveHistoryKey, HistoryDefault); Provider.of<FlwtchState>(context, listen: false).cwtch.SetConversationAttribute(profileOnion, identifier, SaveHistoryKey, HistoryDefault);
} else if (newValue == AppLocalizations.of(context)!.savePeerHistory) { } else if (newValue == AppLocalizations.of(context)!.savePeerHistory) {
@ -246,7 +246,11 @@ class _PeerSettingsViewState extends State<PeerSettingsView> {
} }
}); });
}, },
items: [AppLocalizations.of(context)!.conversationNotificationPolicyDefault, AppLocalizations.of(context)!.savePeerHistory, AppLocalizations.of(context)!.dontSavePeerHistory].map<DropdownMenuItem<String>>((String value) { items: [
AppLocalizations.of(context)!.conversationNotificationPolicyDefault,
AppLocalizations.of(context)!.savePeerHistory,
AppLocalizations.of(context)!.dontSavePeerHistory
].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value, value: value,
child: Text(value, style: settings.scaleFonts(defaultDropDownMenuItemTextStyle)), child: Text(value, style: settings.scaleFonts(defaultDropDownMenuItemTextStyle)),

View File

@ -97,9 +97,11 @@ class _RemoteServerViewState extends State<RemoteServerView> {
Tooltip( Tooltip(
message: serverInfoState.groups.isNotEmpty ? AppLocalizations.of(context)!.cannotDeleteServerIfActiveGroups : AppLocalizations.of(context)!.leaveConversation, message: serverInfoState.groups.isNotEmpty ? AppLocalizations.of(context)!.cannotDeleteServerIfActiveGroups : AppLocalizations.of(context)!.leaveConversation,
child: ElevatedButton.icon( child: ElevatedButton.icon(
onPressed: serverInfoState.groups.isNotEmpty ? null : () { onPressed: serverInfoState.groups.isNotEmpty
showAlertDialog(context); ? null
}, : () {
showAlertDialog(context);
},
icon: Icon(CwtchIcons.leave_group), icon: Icon(CwtchIcons.leave_group),
label: Text( label: Text(
AppLocalizations.of(context)!.deleteBtn, AppLocalizations.of(context)!.deleteBtn,
@ -112,7 +114,6 @@ class _RemoteServerViewState extends State<RemoteServerView> {
child: Text(AppLocalizations.of(context)!.groupsOnThisServerLabel), child: Text(AppLocalizations.of(context)!.groupsOnThisServerLabel),
), ),
Expanded(child: _buildGroupsList(serverInfoState)), Expanded(child: _buildGroupsList(serverInfoState)),
]))); ])));
}); });
} }

View File

@ -38,7 +38,7 @@ class _MessageListState extends State<MessageList> {
//bool isGroupAndSynced = Provider.of<ContactInfoState>(context).isGroup && Provider.of<ContactInfoState>(context).status == "Synced"; //bool isGroupAndSynced = Provider.of<ContactInfoState>(context).isGroup && Provider.of<ContactInfoState>(context).status == "Synced";
//bool isGroupAndNotAuthenticated = Provider.of<ContactInfoState>(context).isGroup && Provider.of<ContactInfoState>(context).status != "Authenticated"; //bool isGroupAndNotAuthenticated = Provider.of<ContactInfoState>(context).isGroup && Provider.of<ContactInfoState>(context).status != "Authenticated";
bool preserveHistoryByDefault = Provider.of<Settings>(context, listen:false).preserveHistoryByDefault; bool preserveHistoryByDefault = Provider.of<Settings>(context, listen: false).preserveHistoryByDefault;
bool showEphemeralWarning = (isP2P && (!preserveHistoryByDefault && Provider.of<ContactInfoState>(context).savePeerHistory != "SaveHistory")); bool showEphemeralWarning = (isP2P && (!preserveHistoryByDefault && Provider.of<ContactInfoState>(context).savePeerHistory != "SaveHistory"));
bool showOfflineWarning = Provider.of<ContactInfoState>(context).isOnline() == false; bool showOfflineWarning = Provider.of<ContactInfoState>(context).isOnline() == false;
bool showSyncing = isGroupAndSyncing; bool showSyncing = isGroupAndSyncing;