Merge pull request 'Set Group Attribute' (#28) from groups into trunk
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
Reviewed-on: #28
This commit is contained in:
commit
65fd80b21a
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
|
||||
func main() {}
|
||||
|
|
|
@ -130,6 +130,7 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string {
|
|||
if err == nil {
|
||||
servers = append(servers, groupHandler.GetServerInfo(contact, profile))
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
contactInfo := profile.GetContact(contact)
|
||||
|
|
Loading…
Reference in New Issue