From ba4b31f06b613ffdea98aedca39d7819feda1c82 Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Sun, 19 Dec 2021 13:52:10 -0500 Subject: [PATCH] fix some name sync behaviour --- utils/eventHandler.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/eventHandler.go b/utils/eventHandler.go index 7316544..b395e56 100644 --- a/utils/eventHandler.go +++ b/utils/eventHandler.go @@ -265,6 +265,9 @@ func (eh *EventHandler) handleProfileEvent(ev *EventProfileEnvelope) string { ev.Event.Data["Nick"], exists = ci.GetAttribute(attr.PublicScope, attr.ProfileZone, constants.Name) if !exists { ev.Event.Data["Nick"] = ev.Event.Data["RemotePeer"] + // If we dont have a name val for a peer, but they have sent us a message, we might be approved now, re-ask + profile.SendScopedZonedGetValToContact(ci.ID, attr.PublicScope, attr.ProfileZone, constants.Name) + profile.SendScopedZonedGetValToContact(ci.ID, attr.PublicScope, attr.ProfileZone, constants2.Picture) } } ev.Event.Data["Picture"] = RandomProfileImage(ev.Event.Data["RemotePeer"]) @@ -379,7 +382,7 @@ func (eh *EventHandler) handleProfileEvent(ev *EventProfileEnvelope) string { if exists && attr.IntoScope(scope) == attr.PublicScope { zone, path := attr.ParseZone(path) - if _, err := profile.GetConversationAttribute(conversationID, attr.LocalScope.ConstructScopedZonedPath(zone.ConstructZonedPath(path))); err != nil { + if val, err := profile.GetConversationAttribute(conversationID, attr.LocalScope.ConstructScopedZonedPath(zone.ConstructZonedPath(path))); err != nil && val != "" { // we have a locally set override, don't pass this remote set public scope update to UI return "" }