From 65ecbad4d3bf2cdb2e0c30e0633ac90f9c3edb31 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Fri, 15 Oct 2021 13:43:02 -0700 Subject: [PATCH] Add temporary override for profile.name --- peer/cwtch_peer.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/peer/cwtch_peer.go b/peer/cwtch_peer.go index 20abd93..e3d9de5 100644 --- a/peer/cwtch_peer.go +++ b/peer/cwtch_peer.go @@ -853,8 +853,14 @@ func (cp *cwtchPeer) eventHandler() { if remotePeer != nil && remotePeer.Authorization == model.AuthApproved { scope := attr.IntoScope(scope) if scope.IsPublic() || scope.IsConversation() { - zone, path := attr.ParseZone(path) - val, exists := cp.GetScopedZonedAttribute(scope, zone, path) + zone, zpath := attr.ParseZone(path) + val, exists := cp.GetScopedZonedAttribute(scope, zone, zpath) + + // NOTE: Temporary Override because UI currently wipes names if it can't find them... + if !exists && zone == attr.UnknownZone && path == constants.Name { + val, exists = cp.GetScopedZonedAttribute(attr.PublicScope, attr.ProfileZone, constants.Name) + } + resp := event.NewEvent(event.SendRetValMessageToPeer, map[event.Field]string{event.RemotePeer: onion, event.Exists: strconv.FormatBool(exists)}) resp.EventID = ev.EventID if exists {