Rename group package and defaults to halls
This commit is contained in:
+16
-16
@@ -24,7 +24,7 @@ import (
|
||||
|
||||
gcodecs "git.stormux.org/storm/skald/codecs"
|
||||
"git.stormux.org/storm/skald/conn"
|
||||
"git.stormux.org/storm/skald/group"
|
||||
"git.stormux.org/storm/skald/hall"
|
||||
"git.stormux.org/storm/skald/rtptime"
|
||||
)
|
||||
|
||||
@@ -36,8 +36,8 @@ const (
|
||||
var Directory string
|
||||
|
||||
type Client struct {
|
||||
group *group.Group
|
||||
id string
|
||||
hall *hall.Hall
|
||||
id string
|
||||
|
||||
mu sync.Mutex
|
||||
down map[string]*diskConn
|
||||
@@ -50,12 +50,12 @@ func newId() string {
|
||||
return hex.EncodeToString(b)
|
||||
}
|
||||
|
||||
func New(g *group.Group) *Client {
|
||||
return &Client{group: g, id: newId()}
|
||||
func New(g *hall.Hall) *Client {
|
||||
return &Client{hall: g, id: newId()}
|
||||
}
|
||||
|
||||
func (client *Client) Group() *group.Group {
|
||||
return client.group
|
||||
func (client *Client) Hall() *hall.Hall {
|
||||
return client.hall
|
||||
}
|
||||
|
||||
func (client *Client) Id() string {
|
||||
@@ -86,7 +86,7 @@ func (client *Client) PushClient(group, kind, id, username string, perms []strin
|
||||
return nil
|
||||
}
|
||||
|
||||
func (client *Client) RequestConns(target group.Client, g *group.Group, id string) error {
|
||||
func (client *Client) RequestConns(target hall.Client, g *hall.Hall, id string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ func (client *Client) Close() error {
|
||||
|
||||
func (client *Client) Kick(id string, user *string, message string) error {
|
||||
err := client.Close()
|
||||
group.DelClient(client)
|
||||
hall.DelClient(client)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -116,8 +116,8 @@ func (client *Client) Joined(group, kind string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (client *Client) PushConn(g *group.Group, id string, up conn.Up, tracks []conn.UpTrack, replace string) error {
|
||||
if client.group != g {
|
||||
func (client *Client) PushConn(g *hall.Hall, id string, up conn.Up, tracks []conn.UpTrack, replace string) error {
|
||||
if client.hall != g {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ func (client *Client) PushConn(g *group.Group, id string, up conn.Up, tracks []c
|
||||
return nil
|
||||
}
|
||||
|
||||
directory := filepath.Join(Directory, client.group.Name())
|
||||
directory := filepath.Join(Directory, client.hall.Name())
|
||||
err := os.MkdirAll(directory, 0700)
|
||||
if err != nil {
|
||||
g.WallOps("Write to disk: " + err.Error())
|
||||
@@ -192,7 +192,7 @@ func (conn *diskConn) warn(message string) {
|
||||
return
|
||||
}
|
||||
log.Println(message)
|
||||
conn.client.group.WallOps(message)
|
||||
conn.client.hall.WallOps(message)
|
||||
conn.lastWarning = now
|
||||
}
|
||||
|
||||
@@ -330,7 +330,7 @@ func newDiskConn(client *Client, directory string, up conn.Up, remoteTracks []co
|
||||
if audio == nil {
|
||||
audio = remote
|
||||
} else {
|
||||
client.group.WallOps("Multiple audio tracks, recording just one")
|
||||
client.hall.WallOps("Multiple audio tracks, recording just one")
|
||||
}
|
||||
} else if strings.EqualFold(codec, "video/vp8") ||
|
||||
strings.EqualFold(codec, "video/vp9") ||
|
||||
@@ -338,10 +338,10 @@ func newDiskConn(client *Client, directory string, up conn.Up, remoteTracks []co
|
||||
if video == nil || video.Label() == "l" {
|
||||
video = remote
|
||||
} else if remote.Label() != "l" {
|
||||
client.group.WallOps("Multiple video tracks, recording just one")
|
||||
client.hall.WallOps("Multiple video tracks, recording just one")
|
||||
}
|
||||
} else {
|
||||
client.group.WallOps("Unknown codec, " + codec + ", not recording")
|
||||
client.hall.WallOps("Unknown codec, " + codec + ", not recording")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user