Skip to content

Commit

Permalink
Add one more check
Browse files Browse the repository at this point in the history
  • Loading branch information
nkonev committed Jan 14, 2024
1 parent a1b8d90 commit 28a2dc9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion video/services/invitation_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (srv *ChatInvitationService) SendInvitationsWithStatuses(ctx context.Contex

// this is sending call invitations to all the ivitees
for _, chatInviteName := range inviteNames {
status, err := srv.redisService.GetUserCallStatus(ctx, chatInviteName.UserId)
status, innerChatId, _, _, err := srv.redisService.GetUserCallState(ctx, chatInviteName.UserId)
if err != nil {
GetLogEntry(ctx).Errorf("Error during getting callStatus of %v: %v", chatInviteName.UserId, err)
continue
Expand All @@ -52,6 +52,11 @@ func (srv *ChatInvitationService) SendInvitationsWithStatuses(ctx context.Contex
continue
}

if innerChatId != chatId {
GetLogEntry(ctx).Warnf("Call status for user %v contain another chatId %v, the correct chatId should be %v", chatInviteName.UserId, innerChatId, chatId)
continue
}

invitation := dto.VideoCallInvitation{
ChatId: chatId,
ChatName: chatInviteName.Name,
Expand Down

0 comments on commit 28a2dc9

Please sign in to comment.