Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (
wsEventUserVideoOff = "user_video_off"
wsEventCallStart = "call_start"
wsEventCallState = "call_state"
wsEventCallEnd = "call_ended"
wsEventCallEnd = "call_end"
wsEventUserRaiseHand = "user_raise_hand"
wsEventUserUnraiseHand = "user_unraise_hand"
wsEventUserReacted = "user_reacted"
Expand Down
6 changes: 3 additions & 3 deletions server/websocket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ func TestHandleJoin(t *testing.T) {
mockAPI.On("PublishWebSocketEvent", wsEventUserLeft, map[string]any{"session_id": connID, "user_id": userID},
&model.WebsocketBroadcast{ChannelId: channelID, ReliableClusterSend: true}).Once()

// Last participant leaving triggers the call_ended broadcast.
// Last participant leaving triggers the call_end broadcast.
mockMetrics.On("IncWebSocketEvent", "out", wsEventCallEnd).Once()
mockAPI.On("PublishWebSocketEvent", wsEventCallEnd, map[string]any{},
&model.WebsocketBroadcast{ChannelId: channelID, ReliableClusterSend: true}).Once()
Expand Down Expand Up @@ -1042,7 +1042,7 @@ func TestHandleJoin(t *testing.T) {
mockAPI.On("PublishWebSocketEvent", wsEventUserLeft, mock.Anything,
&model.WebsocketBroadcast{ChannelId: channelID, ReliableClusterSend: true}).Times(10)

// Last participant leaving triggers the call_ended broadcast.
// Last participant leaving triggers the call_end broadcast.
mockMetrics.On("IncWebSocketEvent", "out", wsEventCallEnd).Once()
mockAPI.On("PublishWebSocketEvent", wsEventCallEnd, map[string]any{},
&model.WebsocketBroadcast{ChannelId: channelID, ReliableClusterSend: true}).Once()
Expand Down Expand Up @@ -1388,7 +1388,7 @@ func TestHandleJoin(t *testing.T) {
mockAPI.On("PublishWebSocketEvent", wsEventUserLeft, map[string]any{"session_id": connID, "user_id": userID},
&model.WebsocketBroadcast{ChannelId: channelID, ReliableClusterSend: true}).Once()

// Last participant leaving triggers the call_ended broadcast.
// Last participant leaving triggers the call_end broadcast.
mockMetrics.On("IncWebSocketEvent", "out", wsEventCallEnd).Once()
mockAPI.On("PublishWebSocketEvent", wsEventCallEnd, map[string]any{},
&model.WebsocketBroadcast{ChannelId: channelID, ReliableClusterSend: true}).Once()
Expand Down
2 changes: 1 addition & 1 deletion standalone/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ export default async function initialiseEmbedApp(cfg: InitConfig) {
case `custom_${pluginId}_call_start`:
handleCallStart(store, ev as WebSocketMessage<CallStartData>);
break;
case `custom_${pluginId}_call_ended`:
case `custom_${pluginId}_call_end`:
handleCallEnd(store, ev as WebSocketMessage<EmptyData>);
break;
case `custom_${pluginId}_user_joined`:
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export default class Plugin {
handleCallStart(store, ev);
});

registry.registerWebSocketEventHandler(`custom_${pluginId}_call_ended`, (ev) => {
registry.registerWebSocketEventHandler(`custom_${pluginId}_call_end`, (ev) => {
handleCallEnd(store, ev);
});

Expand Down
12 changes: 6 additions & 6 deletions webapp/src/reducers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {combineReducers} from 'redux';
import {MAX_NUM_REACTIONS_IN_REACTION_STREAM} from 'src/constants';
import {reducer as screenSharingIDs} from 'src/state/screen_sharing_ids/reducer';
import {
CALL_ENDED,
CALL_END,
UN_INITIALIZED,
USER_JOINED,
USER_LEFT,
Expand Down Expand Up @@ -129,7 +129,7 @@ const clientStateReducer = (state: clientState = null, action: clientStateAction
}
return state;
}
case CALL_ENDED: {
case CALL_END: {
const data = action.data as callEndData;
if (data.channelID === state?.channelID) {
return null;
Expand Down Expand Up @@ -400,7 +400,7 @@ const calls = (state: callsState = {}, action: callStateAction) => {
...action.data,
},
};
case CALL_ENDED: {
case CALL_END: {
const nextState = {...state};
delete nextState[action.data.channelID];
return nextState;
Expand Down Expand Up @@ -440,7 +440,7 @@ const hosts = (state: hostsState = {}, action: hostsStateAction) => {
},
};
}
case CALL_ENDED: {
case CALL_END: {
const nextState = {...state};
delete nextState[action.data.channelID];
return nextState;
Expand Down Expand Up @@ -585,7 +585,7 @@ const recentlyJoinedUsers = (state: recentlyJoinedUsersState = {}, action: recen
...state,
[action.data.channelID]: state[action.data.channelID]?.filter((val) => val !== action.data.userID),
};
case CALL_ENDED:
case CALL_END:
return {
...state,
[action.data.channelID]: [],
Expand Down Expand Up @@ -663,7 +663,7 @@ const didRingForCalls = (state: { [callID: string]: boolean } = {}, action: Ring
[action.data.callID]: true,
};
}
case CALL_ENDED: {
case CALL_END: {
const nextState = {...state};
delete nextState[action.data.callID];
return nextState;
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/state/screen_sharing_ids/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import {UserSessionState} from '@mattermost/calls-common/lib/types';
import {Reducer} from 'redux';
import {CALL_ENDED, UN_INITIALIZED, USER_LEFT} from 'src/state/session/action_types';
import {CALL_END, UN_INITIALIZED, USER_LEFT} from 'src/state/session/action_types';

import {USER_SCREEN_OFF, USER_SCREEN_ON} from './action_types';
import {Actions} from './actions';
Expand Down Expand Up @@ -59,7 +59,7 @@ export const reducer: Reducer<State, Actions> = (initialState = emptyState, acti
return nextState;
}

case CALL_ENDED: {
case CALL_END: {
const nextState = {...initialState};
delete nextState[action.data.channelID];

Expand Down
2 changes: 1 addition & 1 deletion webapp/src/state/session/action_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ export const USER_HAND_LOWERED = `${pluginId}_user_hand_lowered` as const;
export const USER_REACTED = `${pluginId}_user_reacted` as const;
export const USER_REACTED_TIMEOUT = `${pluginId}_user_reacted_timeout` as const;
export const USER_LEFT = `${pluginId}_user_left` as const;
export const CALL_ENDED = `${pluginId}_call_ended` as const;
export const CALL_END = `${pluginId}_call_end` as const;

4 changes: 2 additions & 2 deletions webapp/src/state/session/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {Channel} from '@mattermost/types/channels';
import {UserProfile} from '@mattermost/types/users';

import {
CALL_ENDED,
CALL_END,
SESSIONS_RECEIVED,
UN_INITIALIZED,
USER_HAND_LOWERED,
Expand Down Expand Up @@ -130,7 +130,7 @@ export const userLeft = (channelID: Channel['id'], sessionID: string, userID: Us
export type ActionUserLeft = ReturnType<typeof userLeft>

export const callEnded = (channelID: Channel['id'], callID: string) => ({
type: CALL_ENDED,
type: CALL_END,
data: {
channelID,
callID,
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/state/session/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {Channel} from '@mattermost/types/channels';
import {Reducer} from 'redux';

import {
CALL_ENDED,
CALL_END,
SESSIONS_RECEIVED,
UN_INITIALIZED,
USER_HAND_LOWERED,
Expand Down Expand Up @@ -233,7 +233,7 @@ export const reducer: Reducer<State, Actions> = (initialState = emptyState, acti
};
}

case CALL_ENDED: {
case CALL_END: {
const nextState = {...initialState};
delete nextState[action.data.channelID];

Expand Down
Loading