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" -> { "SendInvitation" -> {
val profile = (a.get("ProfileOnion") as? String) ?: "" val profile = (a.get("ProfileOnion") as? String) ?: ""
val conversation = a.getInt("conversation").toLong() 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) Cwtch.sendInvitation(profile, conversation, target)
} }
"ShareFile" -> { "ShareFile" -> {
@ -300,12 +300,12 @@ class FlwtchWorker(context: Context, parameters: WorkerParameters) :
} }
"ArchiveConversation" -> { "ArchiveConversation" -> {
val profile = (a.get("ProfileOnion") as? String) ?: "" 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) Cwtch.archiveConversation(profile, conversation)
} }
"DeleteConversation" -> { "DeleteConversation" -> {
val profile = (a.get("ProfileOnion") as? String) ?: "" 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) Cwtch.deleteContact(profile, conversation)
} }
"SetProfileAttribute" -> { "SetProfileAttribute" -> {
@ -316,7 +316,7 @@ class FlwtchWorker(context: Context, parameters: WorkerParameters) :
} }
"SetConversationAttribute" -> { "SetConversationAttribute" -> {
val profile = (a.get("ProfileOnion") as? String) ?: "" 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 key = (a.get("Key") as? String) ?: ""
val v = (a.get("Val") as? String) ?: "" val v = (a.get("Val") as? String) ?: ""
Cwtch.setConversationAttribute(profile, conversation, key, v) 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) { 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"], profileCN.getProfile(data["ProfileOnion"])?.contactList.add(ContactInfoState(data["ProfileOnion"], int.parse(data["ConversationID"]), data["GroupID"],
blocked: data["blocked"] == "true", blocked: false, // we created
accepted: data["accepted"] == "true", accepted: true, // we created
imagePath: data["PicturePath"], imagePath: data["PicturePath"],
nickname: data["GroupName"], nickname: data["GroupName"],
status: status, status: status,
@ -288,8 +288,8 @@ class CwtchNotifier {
if (profileCN.getProfile(data["ProfileOnion"])?.contactList.findContact(groupInvite["GroupID"]) == null) { if (profileCN.getProfile(data["ProfileOnion"])?.contactList.findContact(groupInvite["GroupID"]) == null) {
var identifier = int.parse(data["ConversationID"]); var identifier = int.parse(data["ConversationID"]);
profileCN.getProfile(data["ProfileOnion"])?.contactList.add(ContactInfoState(data["ProfileOnion"], identifier, groupInvite["GroupID"], profileCN.getProfile(data["ProfileOnion"])?.contactList.add(ContactInfoState(data["ProfileOnion"], identifier, groupInvite["GroupID"],
blocked: data["blocked"] == "true", blocked: false, // NewGroup only issued on accepting invite
accepted: data["accepted"] == "true", accepted: true, // NewGroup only issued on accepting invite
imagePath: data["PicturePath"], imagePath: data["PicturePath"],
nickname: groupInvite["GroupName"], nickname: groupInvite["GroupName"],
server: groupInvite["ServerHost"], server: groupInvite["ServerHost"],