From 3985b350f868383e159106693cb6aa5baec062fa Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Fri, 23 Apr 2021 12:31:15 -0700 Subject: [PATCH 1/2] BUGFIX: Don't send Server contacts to the UI --- utils/eventHandler.go | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/eventHandler.go b/utils/eventHandler.go index 1b619a3..c603de7 100644 --- a/utils/eventHandler.go +++ b/utils/eventHandler.go @@ -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) From d5f8dbc48b5172a33b0838041e76f1335185f34e Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Fri, 23 Apr 2021 12:56:20 -0700 Subject: [PATCH 2/2] SetGroupAttribute --- lib.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib.go b/lib.go index 7bd9d41..ed64fb9 100644 --- a/lib.go +++ b/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() {}