diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/EndBreakoutRoomInternalMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/EndBreakoutRoomInternalMsgHdlr.scala index 0c19a1a69b..4a33805f98 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/EndBreakoutRoomInternalMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/EndBreakoutRoomInternalMsgHdlr.scala @@ -15,6 +15,8 @@ trait EndBreakoutRoomInternalMsgHdlr extends HandlerHelpers { if (liveMeeting.props.breakoutProps.captureSlides) { val captureSlidesEvent = BigBlueButtonEvent(msg.breakoutId, CapturePresentationReqInternalMsg("system", msg.parentId)) eventBus.publish(captureSlidesEvent) + + println(liveMeeting.props.breakoutProps.breakoutRooms); } if (liveMeeting.props.breakoutProps.captureNotes) { diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationWithAnnotationsMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationWithAnnotationsMsgHdlr.scala index 7d91706fda..c66cd33fb3 100644 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationWithAnnotationsMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/presentationpod/PresentationWithAnnotationsMsgHdlr.scala @@ -9,10 +9,16 @@ import org.bigbluebutton.core.running.LiveMeeting import org.bigbluebutton.core.util.RandomStringGenerator import org.bigbluebutton.core.models.{ PresentationPod, PresentationPage, PresentationInPod } import java.io.File +import java.util.Calendar trait PresentationWithAnnotationsMsgHdlr extends RightsManagementTrait { this: PresentationPodHdlrs => + def generateFilename(filename: String): String = { + val calendar = Calendar.getInstance() + s"${filename}-${calendar.get(Calendar.HOUR_OF_DAY)}_${calendar.get(Calendar.MINUTE)}" + } + def buildStoreAnnotationsInRedisSysMsg(annotations: StoredAnnotations, liveMeeting: LiveMeeting): BbbCommonEnvCoreMsg = { val routing = collection.immutable.HashMap("sender" -> "bbb-apps-akka") val envelope = BbbCoreEnvelope(StoreAnnotationsInRedisSysMsg.NAME, routing) @@ -159,9 +165,7 @@ trait PresentationWithAnnotationsMsgHdlr extends RightsManagementTrait { val pagesRange: List[Int] = if (allPages) (1 to pageCount).toList else List(currentPage.num) val presentationUploadToken: String = PresentationPodsApp.generateToken("DEFAULT_PRESENTATION_POD", userId) - - // Set filename, checking if it is already in use - val filename: String = liveMeeting.props.meetingProp.name + val filename: String = generateFilename(liveMeeting.props.meetingProp.name) // Informs bbb-web about the token so that when we use it to upload the presentation, it is able to look it up in the list of tokens bus.outGW.send(buildPresentationUploadTokenSysPubMsg(parentMeetingId, userId, presentationUploadToken, filename)) @@ -190,7 +194,7 @@ trait PresentationWithAnnotationsMsgHdlr extends RightsManagementTrait { val routing = Routing.addMsgToClientRouting(MessageTypes.BROADCAST_TO_MEETING, parentMeetingId, "not-used") val envelope = BbbCoreEnvelope(PresentationPageConversionStartedEventMsg.NAME, routing) val header = BbbClientMsgHeader(CaptureSharedNotesReqEvtMsg.NAME, parentMeetingId, "not-used") - val body = CaptureSharedNotesReqEvtMsgBody(m.breakoutId, m.meetingName) + val body = CaptureSharedNotesReqEvtMsgBody(m.breakoutId) val event = CaptureSharedNotesReqEvtMsg(header, body) bus.outGW.send(BbbCommonEnvCoreMsg(envelope, event)) @@ -205,7 +209,7 @@ trait PresentationWithAnnotationsMsgHdlr extends RightsManagementTrait { val userId: String = "system" val jobId: String = s"${m.body.breakoutId}-notes" // Used as the temporaryPresentationId upon upload val jobType = "PadCaptureJob" - val filename = m.body.filename + val filename = generateFilename(m.body.filename) val presentationUploadToken: String = PresentationPodsApp.generateToken("DEFAULT_PRESENTATION_POD", userId) bus.outGW.send(buildPresentationUploadTokenSysPubMsg(m.body.parentMeetingId, userId, presentationUploadToken, filename)) diff --git a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationMsgs.scala b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationMsgs.scala index 035eb7472c..d315fa1d32 100755 --- a/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationMsgs.scala +++ b/bbb-common-message/src/main/scala/org/bigbluebutton/common2/msgs/PresentationMsgs.scala @@ -47,6 +47,6 @@ case class PresAnnStatusEvtMsgBody(presId: String, pageNumber: Int, totalPages: object CaptureSharedNotesReqEvtMsg { val NAME = "CaptureSharedNotesReqEvtMsg" } case class CaptureSharedNotesReqEvtMsg(header: BbbClientMsgHeader, body: CaptureSharedNotesReqEvtMsgBody) extends BbbCoreMsg -case class CaptureSharedNotesReqEvtMsgBody(breakoutId: String, meetingName: String) +case class CaptureSharedNotesReqEvtMsgBody(breakoutId: String) // ------------ akka-apps to client ------------ diff --git a/bigbluebutton-html5/imports/api/pads/server/handlers/captureSharedNotes.js b/bigbluebutton-html5/imports/api/pads/server/handlers/captureSharedNotes.js index 26247d9ddc..46ca90f8cf 100644 --- a/bigbluebutton-html5/imports/api/pads/server/handlers/captureSharedNotes.js +++ b/bigbluebutton-html5/imports/api/pads/server/handlers/captureSharedNotes.js @@ -1,14 +1,20 @@ import { check } from 'meteor/check'; import padCapture from '../methods/padCapture'; -export default function captureSharedNotes({ body }, parentMeetingId) { +export default function captureSharedNotes({ header, body }) { + check(header, Object); check(body, Object); - check(parentMeetingId, String); - const { breakoutId, meetingName } = body; + const { + meetingId: parentMeetingId, + } = header; + + const { + breakoutId, + } = body; check(breakoutId, String); - check(meetingName, String); + check(parentMeetingId, String); - padCapture(breakoutId, parentMeetingId, meetingName); + padCapture(breakoutId, parentMeetingId); } diff --git a/bigbluebutton-html5/imports/api/pads/server/methods/padCapture.js b/bigbluebutton-html5/imports/api/pads/server/methods/padCapture.js index 3cf50061c6..5deed7c6f0 100644 --- a/bigbluebutton-html5/imports/api/pads/server/methods/padCapture.js +++ b/bigbluebutton-html5/imports/api/pads/server/methods/padCapture.js @@ -1,18 +1,15 @@ -import { check } from 'meteor/check'; import Pads from '/imports/api/pads'; +import Breakouts from '/imports/api/breakouts'; import RedisPubSub from '/imports/startup/server/redis'; import Logger from '/imports/startup/server/logger'; -export default function padCapture(breakoutId, parentMeetingId, meetingName) { +export default function padCapture(breakoutId, parentMeetingId) { 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(breakoutId, String); - check(parentMeetingId, String); - check(meetingName, String); + try { const pad = Pads.findOne( { meetingId: breakoutId, @@ -25,12 +22,14 @@ export default function padCapture(breakoutId, parentMeetingId, meetingName) { }, ); - if (pad && pad.padId) { + const breakout = Breakouts.findOne({ breakoutId }); + + if (pad?.padId && breakout?.shortName) { const payload = { parentMeetingId, breakoutId, padId: pad.padId, - filename: `${meetingName}-notes`, + filename: `${breakout.shortName}-notes`, }; Logger.info(`Sending PadCapturePubMsg for meetingId=${breakoutId} parentMeetingId=${parentMeetingId} padId=${pad.padId}`);