mirror of
https://github.com/mumble-voip/grumble.git
synced 2025-12-19 21:59:59 -08:00
Remove JSON left-overs from freezer.
This commit is contained in:
parent
76ca3dcebc
commit
bb4e7a511e
1 changed files with 29 additions and 29 deletions
58
freeze.go
58
freeze.go
|
|
@ -191,30 +191,30 @@ func NewServerFromFrozen(filename string) (s *Server, err os.Error) {
|
||||||
|
|
||||||
// Add all channels, but don't hook up parent/child relationships
|
// Add all channels, but don't hook up parent/child relationships
|
||||||
// until all of them are loaded.
|
// until all of them are loaded.
|
||||||
for _, jc := range fs.Channels {
|
for _, fc := range fs.Channels {
|
||||||
c := NewChannel(jc.Id, jc.Name)
|
c := NewChannel(fc.Id, fc.Name)
|
||||||
c.Position = int(jc.Position)
|
c.Position = int(fc.Position)
|
||||||
c.InheritACL = jc.InheritACL
|
c.InheritACL = fc.InheritACL
|
||||||
c.DescriptionHash = []byte{} // fixme
|
c.DescriptionHash = []byte{} // fixme
|
||||||
|
|
||||||
for _, jacl := range jc.ACL {
|
for _, facl := range fc.ACL {
|
||||||
acl := NewChannelACL(c)
|
acl := NewChannelACL(c)
|
||||||
acl.ApplyHere = jacl.ApplyHere
|
acl.ApplyHere = facl.ApplyHere
|
||||||
acl.ApplySubs = jacl.ApplySubs
|
acl.ApplySubs = facl.ApplySubs
|
||||||
acl.UserId = jacl.UserId
|
acl.UserId = facl.UserId
|
||||||
acl.Group = jacl.Group
|
acl.Group = facl.Group
|
||||||
acl.Deny = Permission(jacl.Deny)
|
acl.Deny = Permission(facl.Deny)
|
||||||
acl.Allow = Permission(jacl.Allow)
|
acl.Allow = Permission(facl.Allow)
|
||||||
c.ACL = append(c.ACL, acl)
|
c.ACL = append(c.ACL, acl)
|
||||||
}
|
}
|
||||||
for _, jgrp := range jc.Groups {
|
for _, fgrp := range fc.Groups {
|
||||||
g := NewGroup(c, jgrp.Name)
|
g := NewGroup(c, fgrp.Name)
|
||||||
g.Inherit = jgrp.Inherit
|
g.Inherit = fgrp.Inherit
|
||||||
g.Inheritable = jgrp.Inheritable
|
g.Inheritable = fgrp.Inheritable
|
||||||
for _, uid := range jgrp.Add {
|
for _, uid := range fgrp.Add {
|
||||||
g.Add[uid] = true
|
g.Add[uid] = true
|
||||||
}
|
}
|
||||||
for _, uid := range jgrp.Remove {
|
for _, uid := range fgrp.Remove {
|
||||||
g.Remove[uid] = true
|
g.Remove[uid] = true
|
||||||
}
|
}
|
||||||
c.Groups[g.Name] = g
|
c.Groups[g.Name] = g
|
||||||
|
|
@ -224,15 +224,15 @@ func NewServerFromFrozen(filename string) (s *Server, err os.Error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hook up children with their parents.
|
// Hook up children with their parents.
|
||||||
for _, jc := range fs.Channels {
|
for _, fc := range fs.Channels {
|
||||||
if jc.Id == 0 {
|
if fc.Id == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
childChan, exists := s.Channels[jc.Id]
|
childChan, exists := s.Channels[fc.Id]
|
||||||
if !exists {
|
if !exists {
|
||||||
return nil, os.NewError("Non-existant child channel")
|
return nil, os.NewError("Non-existant child channel")
|
||||||
}
|
}
|
||||||
parentChan, exists := s.Channels[jc.ParentId]
|
parentChan, exists := s.Channels[fc.ParentId]
|
||||||
if !exists {
|
if !exists {
|
||||||
return nil, os.NewError("Non-existant parent channel")
|
return nil, os.NewError("Non-existant parent channel")
|
||||||
}
|
}
|
||||||
|
|
@ -242,18 +242,18 @@ func NewServerFromFrozen(filename string) (s *Server, err os.Error) {
|
||||||
s.root = s.Channels[0]
|
s.root = s.Channels[0]
|
||||||
|
|
||||||
// Add all users
|
// Add all users
|
||||||
for _, ju := range fs.Users {
|
for _, fu := range fs.Users {
|
||||||
u, err := NewUser(ju.Id, ju.Name)
|
u, err := NewUser(fu.Id, fu.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
u.CertHash = ju.CertHash
|
u.CertHash = fu.CertHash
|
||||||
u.Email = ju.Email
|
u.Email = fu.Email
|
||||||
u.TextureBlob = ju.TextureBlob
|
u.TextureBlob = fu.TextureBlob
|
||||||
u.CommentBlob = ju.CommentBlob
|
u.CommentBlob = fu.CommentBlob
|
||||||
u.LastChannelId = ju.LastChannelId
|
u.LastChannelId = fu.LastChannelId
|
||||||
u.LastActive = ju.LastActive
|
u.LastActive = fu.LastActive
|
||||||
|
|
||||||
s.Users[u.Id] = u
|
s.Users[u.Id] = u
|
||||||
s.UserNameMap[u.Name] = u
|
s.UserNameMap[u.Name] = u
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue