Merge pull request 'Add temporary override for profile.name' (#397) from temp_name_override into master
continuous-integration/drone/tag Build is pending Details
continuous-integration/drone/push Build is passing Details

Reviewed-on: #397
This commit is contained in:
Dan Ballard 2021-10-15 20:45:08 +00:00
commit 3d2b048f28
1 changed files with 8 additions and 2 deletions

View File

@ -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 {