fix gomobile/FlwtchWorker calls incorrectly casting Long for SetContactAttribute and sendInvite
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Dan Ballard 2022-01-06 18:46:49 -05:00
parent 5c6765b565
commit ce7e7df3ae
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"],