import bundle now returns result #94
3
go.mod
3
go.mod
|
@ -5,10 +5,11 @@ go 1.15
|
|||
require (
|
||||
cwtch.im/cwtch v0.17.1
|
||||
git.openprivacy.ca/cwtch.im/server v1.4.2
|
||||
git.openprivacy.ca/openprivacy/connectivity v1.8.4
|
||||
git.openprivacy.ca/openprivacy/connectivity v1.8.5
|
||||
git.openprivacy.ca/openprivacy/log v1.0.3
|
||||
github.com/mutecomm/go-sqlcipher/v4 v4.4.2
|
||||
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect
|
||||
golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a // indirect
|
||||
golang.org/x/text v0.3.7 // indirect
|
||||
)
|
||||
|
||||
|
|
2
go.sum
2
go.sum
|
@ -27,6 +27,8 @@ git.openprivacy.ca/openprivacy/connectivity v1.5.0/go.mod h1:UjQiGBnWbotmBzIw59B
|
|||
git.openprivacy.ca/openprivacy/connectivity v1.8.3/go.mod h1:UjQiGBnWbotmBzIw59B8H6efwDadjkKzm3RPT1UaIRw=
|
||||
git.openprivacy.ca/openprivacy/connectivity v1.8.4 h1:fQIOtvtCtZpB1D2XvmSJUdb8aqSKujPsqMHWXl52150=
|
||||
git.openprivacy.ca/openprivacy/connectivity v1.8.4/go.mod h1:pG50Dq4IelxFGyF1y8dU5kXrnsDGEnobbEFZlB9COLM=
|
||||
git.openprivacy.ca/openprivacy/connectivity v1.8.5 h1:eAlpNyxMBVq/PK+5EkG3zpcCjRjxi6Sg+iVoamuX1co=
|
||||
git.openprivacy.ca/openprivacy/connectivity v1.8.5/go.mod h1:pG50Dq4IelxFGyF1y8dU5kXrnsDGEnobbEFZlB9COLM=
|
||||
git.openprivacy.ca/openprivacy/log v1.0.2/go.mod h1:gGYK8xHtndRLDymFtmjkG26GaMQNgyhioNS82m812Iw=
|
||||
git.openprivacy.ca/openprivacy/log v1.0.3 h1:E/PMm4LY+Q9s3aDpfySfEDq/vYQontlvNj/scrPaga0=
|
||||
git.openprivacy.ca/openprivacy/log v1.0.3/go.mod h1:gGYK8xHtndRLDymFtmjkG26GaMQNgyhioNS82m812Iw=
|
||||
|
|
9
lib.go
9
lib.go
|
@ -1053,15 +1053,15 @@ func DeleteContact(profileHandle string, conversationID int) {
|
|||
}
|
||||
|
||||
//export c_ImportBundle
|
||||
func c_ImportBundle(profile_ptr *C.char, profile_len C.int, bundle_ptr *C.char, bundle_len C.int) {
|
||||
func c_ImportBundle(profile_ptr *C.char, profile_len C.int, bundle_ptr *C.char, bundle_len C.int) *C.char {
|
||||
profile := C.GoStringN(profile_ptr, profile_len)
|
||||
name := C.GoStringN(bundle_ptr, bundle_len)
|
||||
ImportBundle(profile, name)
|
||||
return C.CString(ImportBundle(profile, name))
|
||||
}
|
||||
|
||||
// ImportBundle takes in a handle to a profile and an invite string which could have one of many
|
||||
// different formats (e.g. a peer address, a group invite, a server key bundle, or a combination)
|
||||
func ImportBundle(profileOnion string, bundle string) {
|
||||
func ImportBundle(profileOnion string, bundle string) string {
|
||||
profile := application.GetPeer(profileOnion)
|
||||
if profile != nil {
|
||||
response := profile.ImportBundle(bundle)
|
||||
|
@ -1074,8 +1074,9 @@ func ImportBundle(profileOnion string, bundle string) {
|
|||
eventHandler.Push(event.NewEvent(groups.UpdateServerInfo, map[event.Field]string{"ProfileOnion": profileOnion, groups.ServerList: string(serversListBytes)}))
|
||||
}
|
||||
|
||||
eventHandler.Push(event.NewEvent(event.AppError, map[event.Field]string{event.Data: response.Error()}))
|
||||
return response.Error()
|
||||
}
|
||||
return "no-profile"
|
||||
}
|
||||
|
||||
//export c_SetProfileAttribute
|
||||
|
|
Reference in New Issue