bigbluebutton-Github/bigbluebutton-html5/imports/api/pads/server/methods/padCapture.js
Daniel Petri Rocha dd06ce2660 Show UploadingPresentations toast upon breakout notes capture
Displays a "To be uploaded..." toast in the main meeting while the shared notes of breakout rooms are being captured.
2022-10-19 13:36:25 +02:00

50 lines
1.3 KiB
JavaScript

import { check } from 'meteor/check';
import Pads from '/imports/api/pads';
import RedisPubSub from '/imports/startup/server/redis';
import Logger from '/imports/startup/server/logger';
export default function padCapture(meetingId, parentMeetingId, meetingName, sequence) {
const REDIS_CONFIG = Meteor.settings.private.redis;
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
const EVENT_NAME = 'PadCapturePubMsg';
const EXTERNAL_ID = Meteor.settings.public.notes.id;
try {
check(meetingId, String);
check(parentMeetingId, String);
check(meetingName, String);
check(sequence, Number);
const pad = Pads.findOne(
{
meetingId,
externalId: EXTERNAL_ID,
},
{
fields: {
padId: 1,
},
},
);
const filename = `${meetingName}-notes`;
const payload = {
parentMeetingId,
breakoutId: meetingId,
padId: pad.padId,
filename,
sequence,
};
Logger.info(`Sending PadCapturePubMsg for meetingId=${meetingId} parentMeetingId=${parentMeetingId} padId=${pad.padId}`);
if (pad && pad.padId) {
return RedisPubSub.publishMeetingMessage(CHANNEL, EVENT_NAME, parentMeetingId, payload);
}
return null;
} catch (err) {
Logger.error(`Exception while invoking method padCapture ${err.stack}`);
return null;
}
}