Merge pull request 'fix gomobile/FlwtchWorker calls incorrectly casting Long for SetContactAttribute and sendInvite' (#290) from fixAndroidAttrInv into trunk
continuous-integration/drone/push Build is passing Details

Reviewed-on: #290
Reviewed-by: Sarah Jamie Lewis <sarah@openprivacy.ca>
This commit is contained in:
Sarah Jamie Lewis 2022-01-07 00:23:02 +00:00
commit 8de3f8dc42
2 changed files with 8 additions and 8 deletions

View File

@ -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)

View File

@ -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"],