From a6743af103b1415d6d5cf33835bfc26e14ee4bb1 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Sun, 19 Dec 2021 12:44:04 -0800 Subject: [PATCH 1/3] IndexFailure + Android Change Password Fixups --- .../kotlin/im/cwtch/flwtch/FlwtchWorker.kt | 7 ++++++ lib/cwtch/cwtchNotifier.dart | 24 ++----------------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/android/app/src/main/kotlin/im/cwtch/flwtch/FlwtchWorker.kt b/android/app/src/main/kotlin/im/cwtch/flwtch/FlwtchWorker.kt index ed5283d8..19965a88 100644 --- a/android/app/src/main/kotlin/im/cwtch/flwtch/FlwtchWorker.kt +++ b/android/app/src/main/kotlin/im/cwtch/flwtch/FlwtchWorker.kt @@ -180,6 +180,13 @@ class FlwtchWorker(context: Context, parameters: WorkerParameters) : val pass = (a.get("pass") as? String) ?: "" Cwtch.loadProfiles(pass) } + "ChangePassword" -> { + val profile = (a.get("ProfileOnion") as? String) ?: "" + val pass = (a.get("OldPass") as? String) ?: "" + val passNew = (a.get("NewPass") as? String) ?: "" + val passNew2 = (a.get("NewPassAgain") as? String) ?: "" + Cwtch.changePassword(profile, pass, passNew, passNew2) + } "GetMessage" -> { val profile = (a.get("ProfileOnion") as? String) ?: "" val conversation = a.getInt("conversation").toLong() diff --git a/lib/cwtch/cwtchNotifier.dart b/lib/cwtch/cwtchNotifier.dart index c284d08d..3c433904 100644 --- a/lib/cwtch/cwtchNotifier.dart +++ b/lib/cwtch/cwtchNotifier.dart @@ -229,14 +229,9 @@ class CwtchNotifier { EnvironmentConfig.debugLog("new message from group from yourself - this should not happen"); } break; - case "SendMessageToPeerError": - // Ignore dealt with by IndexedFailure - break; - case "SendMessageToGroupError": - // Ignore dealt with by IndexedFailure - break; case "IndexedFailure": - var contact = profileCN.getProfile(data["ProfileOnion"])?.contactList.findContact(data["RemotePeer"]); + var identifier = int.parse(data["ConversationID"]); + var contact = profileCN.getProfile(data["ProfileOnion"])?.contactList.getContact(identifier); var idx = int.parse(data["Index"]); var key = contact?.getMessageKeyOrFail(contact.identifier, idx); if (key != null) { @@ -315,21 +310,6 @@ class CwtchNotifier { }); profileCN.getProfile(data["ProfileOnion"])?.contactList.resort(); break; - case "SetPeerAttribute": - if (data["Key"] == "local.name") { - if (profileCN.getProfile(data["ProfileOnion"])?.contactList.getContact(data["RemotePeer"]) != null) { - profileCN.getProfile(data["ProfileOnion"])?.contactList.getContact(data["RemotePeer"])!.nickname = data["Data"]; - } - } else if (data["Key"] == "local.archived") { - if (profileCN.getProfile(data["ProfileOnion"])?.contactList.getContact(data["RemotePeer"]) != null) { - profileCN.getProfile(data["ProfileOnion"])?.contactList.getContact(data["RemotePeer"])!.isArchived = data["Data"] == "true"; - } - } else if (data["Key"] == "LastKnowSignature") { - // group syncing information that isn't relevant to the UI... - } else { - EnvironmentConfig.debugLog("unhandled set peer attribute event: ${data['Key']}"); - } - break; case "NewRetValMessageFromPeer": if (data["Path"] == "profile.name") { if (data["Data"].toString().trim().length > 0) { From 3fde1a0de0b4d9c0eafed51ffcf08fdb6ca83e38 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Sun, 19 Dec 2021 13:20:06 -0800 Subject: [PATCH 2/3] Upgrade Cwtch Versions --- LIBCWTCH-GO-MACOS.version | 2 +- LIBCWTCH-GO.version | 2 +- pubspec.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LIBCWTCH-GO-MACOS.version b/LIBCWTCH-GO-MACOS.version index 76fba53c..73b9cbd2 100644 --- a/LIBCWTCH-GO-MACOS.version +++ b/LIBCWTCH-GO-MACOS.version @@ -1 +1 @@ -2021-12-18-20-32-v1.5.1 \ No newline at end of file +2021-12-19-15-59-v1.5.1-6-g95c3670 \ No newline at end of file diff --git a/LIBCWTCH-GO.version b/LIBCWTCH-GO.version index d7e07e7c..8ba39ef3 100644 --- a/LIBCWTCH-GO.version +++ b/LIBCWTCH-GO.version @@ -1 +1 @@ -2021-12-19-01-32-v1.5.1 \ No newline at end of file +2021-12-19-20-58-v1.5.1-6-g95c3670 \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index f116e49d..92a1b212 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.4.0+22 +version: 1.5.0+22 environment: sdk: ">=2.12.0 <3.0.0" From 6928ff562b8edd79fed7eae8bc2cdb5a7b7fc096 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Sun, 19 Dec 2021 14:13:04 -0800 Subject: [PATCH 3/3] Bump Minor --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 92a1b212..6e0326d0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.5.0+22 +version: 1.5.0+23 environment: sdk: ">=2.12.0 <3.0.0"