tangled
alpha
login
or
join now
moth11.net
/
lrcd
2
fork
atom
websocket-based lrcproto server
2
fork
atom
overview
issues
pulls
pipelines
defer unlock
moth11.net
6 months ago
69eddc6a
2f8d47fe
+2
-3
1 changed file
expand all
collapse all
unified
split
server.go
+2
-3
server.go
···
495
495
func (s *Server) handleMute(msg *lrcpb.Event_Mute, client *client) {
496
496
toMute := msg.Mute.GetId()
497
497
s.idmapsMu.Lock()
498
498
+
defer s.idmapsMu.Unlock()
498
499
clientToMute, ok := s.idToClient[toMute]
499
500
if !ok {
500
501
return
···
504
505
}
505
506
clientToMute.mutedBy[client] = true
506
507
client.muteMap[clientToMute] = true
507
507
-
s.idmapsMu.Unlock()
508
508
509
509
}
510
510
511
511
func (s *Server) handleUnmute(msg *lrcpb.Event_Unmute, client *client) {
512
512
toMute := msg.Unmute.GetId()
513
513
s.idmapsMu.Lock()
514
514
+
defer s.idmapsMu.Unlock()
514
515
clientToMute, ok := s.idToClient[toMute]
515
516
if !ok {
516
517
return
···
520
521
}
521
522
delete(clientToMute.mutedBy, client)
522
523
delete(client.muteMap, clientToMute)
523
523
-
s.idmapsMu.Unlock()
524
524
-
525
524
}
526
525
527
526
func (s *Server) handleSet(msg *lrcpb.Event_Set, client *client) {