SetGroupAttribute
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
3985b350f8
commit
d5f8dbc48b
19
lib.go
19
lib.go
|
@ -521,5 +521,24 @@ func ImportBundle(profileOnion string, bundle string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//export c_SetGroupAttribute
|
||||||
|
func c_SetGroupAttribute(profile_ptr *C.char, profile_len C.int, group_ptr *C.char, group_len C.int, key_ptr *C.char, key_len C.int, val_ptr *C.char, val_len C.int) {
|
||||||
|
profileOnion := C.GoStringN(profile_ptr, profile_len)
|
||||||
|
groupHandle := C.GoStringN(group_ptr, group_len)
|
||||||
|
key := C.GoStringN(key_ptr, key_len)
|
||||||
|
value := C.GoStringN(val_ptr, val_len)
|
||||||
|
SetGroupAttribute(profileOnion, groupHandle, key, value)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetGroupAttribute provides a wrapper around profile.SetGroupAttribute, gated by global experiments...
|
||||||
|
func SetGroupAttribute(profileOnion string, groupHandle string, key string, value string) {
|
||||||
|
profile := application.GetPeer(profileOnion)
|
||||||
|
_, err := groups.ExperimentGate(utils.ReadGlobalSettings().Experiments)
|
||||||
|
if err == nil {
|
||||||
|
profile.SetGroupAttribute(groupHandle, key, value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Leave as is, needed by ffi
|
// Leave as is, needed by ffi
|
||||||
func main() {}
|
func main() {}
|
||||||
|
|
Loading…
Reference in New Issue