fix some name sync behaviour
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
68c02502a2
commit
ba4b31f06b
|
@ -265,6 +265,9 @@ func (eh *EventHandler) handleProfileEvent(ev *EventProfileEnvelope) string {
|
||||||
ev.Event.Data["Nick"], exists = ci.GetAttribute(attr.PublicScope, attr.ProfileZone, constants.Name)
|
ev.Event.Data["Nick"], exists = ci.GetAttribute(attr.PublicScope, attr.ProfileZone, constants.Name)
|
||||||
if !exists {
|
if !exists {
|
||||||
ev.Event.Data["Nick"] = ev.Event.Data["RemotePeer"]
|
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"])
|
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 {
|
if exists && attr.IntoScope(scope) == attr.PublicScope {
|
||||||
zone, path := attr.ParseZone(path)
|
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
|
// we have a locally set override, don't pass this remote set public scope update to UI
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue