Skip to content

Commit

Permalink
Fix self join sound in case of multi sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
streamer45 committed Feb 19, 2025
1 parent 693d026 commit c6d5b6a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions webapp/src/websocket_handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ import {Store} from './types/mattermost-webapp';
import {
followThread,
getCallsClient,
getCallsClientSessionID,
getUserDisplayName,
notificationsStopRinging,
playSound,
Expand Down Expand Up @@ -179,9 +180,9 @@ export function handleUserJoined(store: Store, ev: WebSocketMessage<UserJoinedDa
const sessionID = ev.data.session_id;

if (window.callsClient?.channelID === channelID) {
if (userID === currentUserID) {
if (sessionID === getCallsClientSessionID()) {
playSound('join_self');
} else if (shouldPlayJoinUserSound(store.getState())) {
} else if (userID !== currentUserID && shouldPlayJoinUserSound(store.getState())) {
playSound('join_user');
}
}
Expand Down

0 comments on commit c6d5b6a

Please sign in to comment.