From c51276596b313ef24d1fc072965ee5576d5b76c1 Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Mon, 11 Oct 2021 13:44:54 +0200 Subject: [PATCH] Internal clients always may subscribe all streams. Follow-up to #133. --- hub.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hub.go b/hub.go index 8b70897..9b6e001 100644 --- a/hub.go +++ b/hub.go @@ -1677,6 +1677,11 @@ func sendMcuProcessingFailed(session *ClientSession, message *ClientMessage) { } func (h *Hub) isInSameCall(senderSession *ClientSession, recipientSessionId string) bool { + if senderSession.ClientType() == HelloClientTypeInternal { + // Internal clients may subscribe all streams. + return true + } + senderRoom := senderSession.GetRoom() if senderRoom == nil || !senderRoom.IsSessionInCall(senderSession) { // Sender is not in a room or not in the call. @@ -1690,7 +1695,8 @@ func (h *Hub) isInSameCall(senderSession *ClientSession, recipientSessionId stri } recipientRoom := recipientSession.GetRoom() - if recipientRoom == nil || !senderRoom.IsEqual(recipientRoom) || !recipientRoom.IsSessionInCall(recipientSession) { + if recipientRoom == nil || !senderRoom.IsEqual(recipientRoom) || + (recipientSession.ClientType() != HelloClientTypeInternal && !recipientRoom.IsSessionInCall(recipientSession)) { // Recipient is not in a room, a different room or not in the call. return false }