Use localname when loading a profile as public name may not have been set...
This commit is contained in:
parent
2f14966051
commit
0f5d0389ca
|
@ -88,7 +88,6 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string {
|
|||
tag, _ := profile.GetScopedZonedAttribute(attr.LocalScope, attr.ProfileZone, constants.Tag)
|
||||
e.Data[constants.Tag] = tag
|
||||
|
||||
|
||||
if e.Data[event.Created] == event.True {
|
||||
name, _ := profile.GetScopedZonedAttribute(attr.LocalScope, attr.ProfileZone, constants.Name)
|
||||
profile.SetScopedZonedAttribute(attr.PublicScope, attr.ProfileZone, constants.Name, name)
|
||||
|
@ -116,12 +115,12 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string {
|
|||
}
|
||||
}
|
||||
|
||||
nick, exists := profile.GetScopedZonedAttribute(attr.PublicScope, attr.ProfileZone, constants.Name)
|
||||
nick, exists := profile.GetScopedZonedAttribute(attr.LocalScope, attr.ProfileZone, constants.Name)
|
||||
if !exists {
|
||||
nick = onion
|
||||
}
|
||||
|
||||
picVal, ok := profile.GetScopedZonedAttribute(attr.PublicScope, attr.ProfileZone, constants2.Picture)
|
||||
picVal, ok := profile.GetScopedZonedAttribute(attr.LocalScope, attr.ProfileZone, constants2.Picture)
|
||||
if !ok {
|
||||
picVal = ImageToString(NewImage(RandomProfileImage(onion), TypeImageDistro))
|
||||
}
|
||||
|
@ -131,6 +130,10 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string {
|
|||
}
|
||||
picPath := GetPicturePath(pic)
|
||||
|
||||
// Set publicly scopes attributes
|
||||
profile.SetScopedZonedAttribute(attr.PublicScope, attr.ProfileZone, constants.Name, nick)
|
||||
profile.SetScopedZonedAttribute(attr.PublicScope, attr.ProfileZone, constants2.Picture, picPath)
|
||||
|
||||
online, _ := profile.GetScopedZonedAttribute(attr.LocalScope, attr.ProfileZone, constants2.PeerOnline)
|
||||
|
||||
e.Data[constants.Name] = nick
|
||||
|
|
Reference in New Issue