Skip to content

Commit

Permalink
extra logging
Browse files Browse the repository at this point in the history
  • Loading branch information
canergulay committed Aug 23, 2024
1 parent b92df68 commit c706e6c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions server/handle_candidate.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,20 @@ func (w wsServer) handleIceCandidate(message dto.Message, user *model.User) {
// send iceCandidate to all users in the connection except the candidate owner
for _, userID := range connection.Users {
if userID == user.ID {
logrus.Info("userID is same, skipping")
continue
}

user := w.userHub.GetUserById(userID)
if user == nil {
userToSend := w.userHub.GetUserById(userID)
if userToSend == nil {
logrus.Warnf("unable to find userID %s", userID)
continue
}

w.sendMessage(user.Conn, dto.Message{
w.sendMessage(userToSend.Conn, dto.Message{
Type: enum.ICE_CANDIDATES,
Body: iceCandidate,
})
logrus.Infof("ice candidates are sent to user %s from user %s", userID, user.ID)
logrus.Infof("ice candidates are sent to user %s from user %s", user.ID, userToSend.ID)
}

w.checkForCandidateSentUsersAndTriggerCall(connection)
Expand Down

0 comments on commit c706e6c

Please # to comment.