mirror of
https://github.com/tinode/chat.git
synced 2025-03-14 10:05:07 +00:00
fix insertion of trusted from demo data
This commit is contained in:
@ -44,9 +44,11 @@ func genDb(data *Data) {
|
||||
Auth: types.ModeCAuth,
|
||||
Anon: types.ModeNone,
|
||||
},
|
||||
Tags: uu.Tags,
|
||||
Public: parsePublic(&uu.Public, data.datapath),
|
||||
Trusted: &uu.Trusted,
|
||||
Tags: uu.Tags,
|
||||
Public: parsePublic(&uu.Public, data.datapath),
|
||||
}
|
||||
if !uu.Trusted.IsZero() {
|
||||
user.Trusted = uu.Trusted
|
||||
}
|
||||
user.CreatedAt = getCreatedTime(uu.CreatedAt)
|
||||
|
||||
@ -146,10 +148,12 @@ func genDb(data *Data) {
|
||||
Auth: accessAuth,
|
||||
Anon: accessAnon,
|
||||
},
|
||||
UseBt: gt.Channel,
|
||||
Tags: gt.Tags,
|
||||
Public: parsePublic(>.Public, data.datapath),
|
||||
Trusted: >.Trusted,
|
||||
UseBt: gt.Channel,
|
||||
Tags: gt.Tags,
|
||||
Public: parsePublic(>.Public, data.datapath),
|
||||
}
|
||||
if !gt.Trusted.IsZero() {
|
||||
topic.Trusted = gt.Trusted
|
||||
}
|
||||
var owner types.Uid
|
||||
if gt.Owner != "" {
|
||||
|
@ -34,8 +34,12 @@ type tPrivate struct {
|
||||
}
|
||||
|
||||
type tTrusted struct {
|
||||
Verified bool `json:"verified"`
|
||||
Staff bool `json:"staff"`
|
||||
Verified bool `json:"verified,omitempty"`
|
||||
Staff bool `json:"staff,omitempty"`
|
||||
}
|
||||
|
||||
func (t tTrusted) IsZero() bool {
|
||||
return !t.Verified && !t.Staff
|
||||
}
|
||||
|
||||
// DefAccess is default access mode.
|
||||
|
Reference in New Issue
Block a user