lock and unlock should now broadcast to the hall. Users trying to enter if hall is locked should now get message indicating the hall is locked. Removed redundant start with options. Browser requests mic permissions, also there is a mute option in the ui itself, so this seemed superfluous
This commit is contained in:
@@ -70,6 +70,18 @@ func broadcastRecordingStatus(g *hall.Hall, message string) {
|
||||
}
|
||||
}
|
||||
|
||||
func broadcastHallInfo(g *hall.Hall, message string) {
|
||||
err := broadcast(g.GetClients(nil), clientMessage{
|
||||
Type: "usermessage",
|
||||
Kind: "info",
|
||||
Privileged: true,
|
||||
Value: message,
|
||||
})
|
||||
if err != nil {
|
||||
log.Printf("broadcast(hall info): %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
type webClient struct {
|
||||
hall *hall.Hall
|
||||
addr net.Addr
|
||||
@@ -1658,6 +1670,11 @@ func handleClientMessage(c *webClient, m clientMessage) error {
|
||||
message = v
|
||||
}
|
||||
g.SetLocked(m.Kind == "lock", message)
|
||||
if m.Kind == "lock" {
|
||||
broadcastHallInfo(g, "Hall locked")
|
||||
} else {
|
||||
broadcastHallInfo(g, "Hall unlocked")
|
||||
}
|
||||
case "record":
|
||||
if !member("record", c.permissions) {
|
||||
return c.error(hall.UserError("not authorised"))
|
||||
|
||||
Reference in New Issue
Block a user