2017-10-12 10:00:28 +08:00
|
|
|
import Meetings from '/imports/api/meetings';
|
2016-10-22 00:27:47 +08:00
|
|
|
import Logger from '/imports/startup/server/logger';
|
|
|
|
|
2019-10-23 09:26:25 +08:00
|
|
|
import { removeAnnotationsStreamer } from '/imports/api/annotations/server/streamer';
|
2019-10-25 04:48:03 +08:00
|
|
|
import { removeCursorStreamer } from '/imports/api/cursor/server/streamer';
|
2020-08-28 18:58:55 +08:00
|
|
|
import { removeExternalVideoStreamer } from '/imports/api/external-videos/server/streamer';
|
2019-10-23 09:26:25 +08:00
|
|
|
|
2017-10-12 10:00:28 +08:00
|
|
|
import clearUsers from '/imports/api/users/server/modifiers/clearUsers';
|
2018-09-14 02:09:30 +08:00
|
|
|
import clearUsersSettings from '/imports/api/users-settings/server/modifiers/clearUsersSettings';
|
2018-08-06 20:05:07 +08:00
|
|
|
import clearGroupChat from '/imports/api/group-chat/server/modifiers/clearGroupChat';
|
2021-02-09 20:30:09 +08:00
|
|
|
import clearGuestUsers from '/imports/api/guest-users/server/modifiers/clearGuestUsers';
|
2017-10-12 10:00:28 +08:00
|
|
|
import clearBreakouts from '/imports/api/breakouts/server/modifiers/clearBreakouts';
|
|
|
|
import clearAnnotations from '/imports/api/annotations/server/modifiers/clearAnnotations';
|
|
|
|
import clearSlides from '/imports/api/slides/server/modifiers/clearSlides';
|
|
|
|
import clearPolls from '/imports/api/polls/server/modifiers/clearPolls';
|
|
|
|
import clearCaptions from '/imports/api/captions/server/modifiers/clearCaptions';
|
2021-10-16 03:07:13 +08:00
|
|
|
import clearPads from '/imports/api/pads/server/modifiers/clearPads';
|
2018-09-20 01:48:15 +08:00
|
|
|
import clearPresentationPods from '/imports/api/presentation-pods/server/modifiers/clearPresentationPods';
|
2017-10-12 10:00:28 +08:00
|
|
|
import clearVoiceUsers from '/imports/api/voice-users/server/modifiers/clearVoiceUsers';
|
2019-04-06 06:32:21 +08:00
|
|
|
import clearUserInfo from '/imports/api/users-infos/server/modifiers/clearUserInfo';
|
2020-04-10 01:01:46 +08:00
|
|
|
import clearConnectionStatus from '/imports/api/connection-status/server/modifiers/clearConnectionStatus';
|
2021-02-10 00:44:49 +08:00
|
|
|
import clearScreenshare from '/imports/api/screenshare/server/modifiers/clearScreenshare';
|
2023-05-11 04:03:20 +08:00
|
|
|
import clearTimer from '/imports/api/timer/server/modifiers/clearTimer';
|
2022-03-25 03:05:20 +08:00
|
|
|
import clearAudioCaptions from '/imports/api/audio-captions/server/modifiers/clearAudioCaptions';
|
2021-02-06 05:42:52 +08:00
|
|
|
import clearMeetingTimeRemaining from '/imports/api/meetings/server/modifiers/clearMeetingTimeRemaining';
|
2019-07-29 22:17:38 +08:00
|
|
|
import clearLocalSettings from '/imports/api/local-settings/server/modifiers/clearLocalSettings';
|
2019-08-27 20:53:53 +08:00
|
|
|
import clearRecordMeeting from './clearRecordMeeting';
|
2021-05-27 03:09:25 +08:00
|
|
|
import clearExternalVideoMeeting from './clearExternalVideoMeeting';
|
2020-02-19 06:03:06 +08:00
|
|
|
import clearVoiceCallStates from '/imports/api/voice-call-states/server/modifiers/clearVoiceCallStates';
|
2020-06-04 00:29:44 +08:00
|
|
|
import clearVideoStreams from '/imports/api/video-streams/server/modifiers/clearVideoStreams';
|
2020-09-01 20:07:56 +08:00
|
|
|
import clearAuthTokenValidation from '/imports/api/auth-token-validation/server/modifiers/clearAuthTokenValidation';
|
2021-03-20 04:12:27 +08:00
|
|
|
import clearUsersPersistentData from '/imports/api/users-persistent-data/server/modifiers/clearUsersPersistentData';
|
2021-07-16 02:43:38 +08:00
|
|
|
import clearReactions from '/imports/api/user-reaction/server/modifiers/clearReactions';
|
2021-03-20 04:12:27 +08:00
|
|
|
|
2021-02-09 20:30:09 +08:00
|
|
|
import clearWhiteboardMultiUser from '/imports/api/whiteboard-multi-user/server/modifiers/clearWhiteboardMultiUser';
|
2020-12-16 00:10:39 +08:00
|
|
|
import Metrics from '/imports/startup/server/metrics';
|
2018-09-20 01:48:15 +08:00
|
|
|
|
2023-03-14 00:59:52 +08:00
|
|
|
export default async function meetingHasEnded(meetingId) {
|
2021-02-16 11:19:31 +08:00
|
|
|
if (!process.env.BBB_HTML5_ROLE || process.env.BBB_HTML5_ROLE === 'frontend') {
|
2021-02-06 01:47:46 +08:00
|
|
|
removeAnnotationsStreamer(meetingId);
|
|
|
|
removeCursorStreamer(meetingId);
|
2020-08-28 18:58:55 +08:00
|
|
|
removeExternalVideoStreamer(meetingId);
|
2021-02-06 01:47:46 +08:00
|
|
|
}
|
2019-10-23 09:26:25 +08:00
|
|
|
|
2023-03-14 00:59:52 +08:00
|
|
|
await Meetings.removeAsync({ meetingId });
|
|
|
|
await Promise.all([
|
|
|
|
clearCaptions(meetingId),
|
|
|
|
clearPads(meetingId),
|
|
|
|
clearGroupChat(meetingId),
|
|
|
|
clearGuestUsers(meetingId),
|
|
|
|
clearPresentationPods(meetingId),
|
|
|
|
clearBreakouts(meetingId),
|
|
|
|
clearPolls(meetingId),
|
|
|
|
clearAnnotations(meetingId),
|
|
|
|
clearSlides(meetingId),
|
|
|
|
clearUsers(meetingId),
|
|
|
|
clearUsersSettings(meetingId),
|
|
|
|
clearVoiceUsers(meetingId),
|
|
|
|
clearUserInfo(meetingId),
|
|
|
|
clearConnectionStatus(meetingId),
|
2023-05-11 04:03:20 +08:00
|
|
|
clearTimer(meetingId),
|
2023-03-14 00:59:52 +08:00
|
|
|
clearAudioCaptions(meetingId),
|
|
|
|
clearLocalSettings(meetingId),
|
|
|
|
clearMeetingTimeRemaining(meetingId),
|
|
|
|
clearRecordMeeting(meetingId),
|
|
|
|
clearExternalVideoMeeting(meetingId),
|
|
|
|
clearVoiceCallStates(meetingId),
|
|
|
|
clearVideoStreams(meetingId),
|
|
|
|
clearAuthTokenValidation(meetingId),
|
|
|
|
clearWhiteboardMultiUser(meetingId),
|
|
|
|
clearScreenshare(meetingId),
|
|
|
|
clearUsersPersistentData(meetingId),
|
2021-07-16 02:43:38 +08:00
|
|
|
clearReactions(meetingId),
|
2023-03-14 00:59:52 +08:00
|
|
|
]);
|
|
|
|
await Metrics.removeMeeting(meetingId);
|
|
|
|
return Logger.info(`Cleared Meetings with id ${meetingId}`);
|
2017-06-03 03:25:02 +08:00
|
|
|
}
|