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 41862380..87e78166 100644 --- a/android/app/src/main/kotlin/im/cwtch/flwtch/FlwtchWorker.kt +++ b/android/app/src/main/kotlin/im/cwtch/flwtch/FlwtchWorker.kt @@ -239,7 +239,7 @@ class FlwtchWorker(context: Context, parameters: WorkerParameters) : "SendInvitation" -> { val profile = (a.get("ProfileOnion") as? String) ?: "" val conversation = a.getInt("conversation").toLong() - val target = (a.get("target") as? Long) ?: -1 + val target = a.getInt("conversation").toLong() Cwtch.sendInvitation(profile, conversation, target) } "ShareFile" -> { @@ -300,12 +300,12 @@ class FlwtchWorker(context: Context, parameters: WorkerParameters) : } "ArchiveConversation" -> { val profile = (a.get("ProfileOnion") as? String) ?: "" - val conversation = (a.get("conversation") as? Long) ?: -1 + val conversation = a.getInt("conversation").toLong() Cwtch.archiveConversation(profile, conversation) } "DeleteConversation" -> { val profile = (a.get("ProfileOnion") as? String) ?: "" - val conversation = (a.get("conversation") as? Long) ?: -1 + val conversation = a.getInt("conversation").toLong() Cwtch.deleteContact(profile, conversation) } "SetProfileAttribute" -> { @@ -316,7 +316,7 @@ class FlwtchWorker(context: Context, parameters: WorkerParameters) : } "SetConversationAttribute" -> { val profile = (a.get("ProfileOnion") as? String) ?: "" - val conversation = (a.get("conversation") as? Long) ?: -1 + val conversation = a.getInt("conversation").toLong() val key = (a.get("Key") as? String) ?: "" val v = (a.get("Val") as? String) ?: "" Cwtch.setConversationAttribute(profile, conversation, key, v) diff --git a/lib/cwtch/cwtchNotifier.dart b/lib/cwtch/cwtchNotifier.dart index 5c37c30c..ab03a8cb 100644 --- a/lib/cwtch/cwtchNotifier.dart +++ b/lib/cwtch/cwtchNotifier.dart @@ -96,8 +96,8 @@ class CwtchNotifier { } if (profileCN.getProfile(data["ProfileOnion"])?.contactList.getContact(int.parse(data["ConversationID"])) == null) { profileCN.getProfile(data["ProfileOnion"])?.contactList.add(ContactInfoState(data["ProfileOnion"], int.parse(data["ConversationID"]), data["GroupID"], - blocked: data["blocked"] == "true", - accepted: data["accepted"] == "true", + blocked: false, // we created + accepted: true, // we created imagePath: data["PicturePath"], nickname: data["GroupName"], status: status, @@ -288,8 +288,8 @@ class CwtchNotifier { if (profileCN.getProfile(data["ProfileOnion"])?.contactList.findContact(groupInvite["GroupID"]) == null) { var identifier = int.parse(data["ConversationID"]); profileCN.getProfile(data["ProfileOnion"])?.contactList.add(ContactInfoState(data["ProfileOnion"], identifier, groupInvite["GroupID"], - blocked: data["blocked"] == "true", - accepted: data["accepted"] == "true", + blocked: false, // NewGroup only issued on accepting invite + accepted: true, // NewGroup only issued on accepting invite imagePath: data["PicturePath"], nickname: groupInvite["GroupName"], server: groupInvite["ServerHost"],