Use constant.Tag instead of AttributeTag
This commit is contained in:
parent
ce8d728471
commit
8ecb105414
|
@ -5,6 +5,7 @@ import (
|
||||||
"cwtch.im/cwtch/event"
|
"cwtch.im/cwtch/event"
|
||||||
"cwtch.im/cwtch/model"
|
"cwtch.im/cwtch/model"
|
||||||
"cwtch.im/cwtch/model/attr"
|
"cwtch.im/cwtch/model/attr"
|
||||||
|
"cwtch.im/cwtch/model/constants"
|
||||||
"cwtch.im/cwtch/peer"
|
"cwtch.im/cwtch/peer"
|
||||||
"cwtch.im/cwtch/protocol/connections"
|
"cwtch.im/cwtch/protocol/connections"
|
||||||
"cwtch.im/cwtch/storage"
|
"cwtch.im/cwtch/storage"
|
||||||
|
@ -19,9 +20,6 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AttributeTag is a const name for a peer attribute that can be set at creation time, for example for versioning info
|
|
||||||
const AttributeTag = "tag"
|
|
||||||
|
|
||||||
type applicationCore struct {
|
type applicationCore struct {
|
||||||
eventBuses map[string]event.Manager
|
eventBuses map[string]event.Manager
|
||||||
|
|
||||||
|
@ -132,7 +130,7 @@ func (app *application) CreateTaggedPeer(name string, password string, tag strin
|
||||||
app.engines[profile.Onion] = engine
|
app.engines[profile.Onion] = engine
|
||||||
|
|
||||||
if tag != "" {
|
if tag != "" {
|
||||||
p.SetScopedZonedAttribute(attr.LocalScope, attr.ProfileZone, AttributeTag, tag)
|
p.SetScopedZonedAttribute(attr.LocalScope, attr.ProfileZone, constants.Tag, tag)
|
||||||
}
|
}
|
||||||
|
|
||||||
app.appBus.Publish(event.NewEvent(event.NewPeer, map[event.Field]string{event.Identity: profile.Onion, event.Created: event.True}))
|
app.appBus.Publish(event.NewEvent(event.NewPeer, map[event.Field]string{event.Identity: profile.Onion, event.Created: event.True}))
|
||||||
|
|
Loading…
Reference in New Issue