fix: Breakout rooms show incorrect presentation filename (#20947)

* Pass arbitrary filename

* Use shortname as presName in breakout room

* Show selected filename in the room
This commit is contained in:
Daniel Petri Rocha 2024-08-22 18:24:19 +02:00 committed by GitHub
parent 1484f516d0
commit 6f08344a70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 54 additions and 32 deletions

View File

@ -20,9 +20,10 @@ object BreakoutModel {
captureSlidesFilename: String,
allPages: Boolean,
presId: String,
sourcePresentationFilename: String,
): BreakoutRoom2x = {
new BreakoutRoom2x(id, externalId, name, parentId, sequence, shortName, isDefaultName, freeJoin, voiceConf, assignedUsers, Vector(), Vector(), None, false,
captureNotes, captureSlides, captureNotesFilename, captureSlidesFilename, allPages, presId)
captureNotes, captureSlides, captureNotesFilename, captureSlidesFilename, allPages, presId, sourcePresentationFilename)
}
}

View File

@ -56,7 +56,7 @@ trait CreateBreakoutRoomsCmdMsgHdlr extends RightsManagementTrait {
val breakout = BreakoutModel.create(parentId, internalId, externalId, room.name, room.sequence, room.shortName,
room.isDefaultName, room.freeJoin, voiceConf, room.users, msg.body.captureNotes,
msg.body.captureSlides, room.captureNotesFilename, room.captureSlidesFilename,
room.allPages, roomPresId)
room.allPages, roomPresId, room.sourcePresentationFilename)
rooms = rooms + (breakout.id -> breakout)
}
@ -78,6 +78,7 @@ trait CreateBreakoutRoomsCmdMsgHdlr extends RightsManagementTrait {
liveMeeting.props.password.viewerPass,
breakout.presId,
roomSlides,
breakout.sourcePresentationFilename,
msg.body.record,
liveMeeting.props.breakoutProps.privateChatEnabled,
breakout.captureNotes,

View File

@ -1,26 +1,27 @@
package org.bigbluebutton.core.domain
case class BreakoutRoom2x(
id: String,
externalId: String,
name: String,
parentId: String,
sequence: Int,
shortName: String,
isDefaultName: Boolean,
freeJoin: Boolean,
voiceConf: String,
assignedUsers: Vector[String],
users: Vector[BreakoutUser],
voiceUsers: Vector[BreakoutVoiceUser],
startedOn: Option[Long],
started: Boolean,
captureNotes: Boolean,
captureSlides: Boolean,
captureNotesFilename: String,
captureSlidesFilename: String,
allPages: Boolean,
presId: String,
id: String,
externalId: String,
name: String,
parentId: String,
sequence: Int,
shortName: String,
isDefaultName: Boolean,
freeJoin: Boolean,
voiceConf: String,
assignedUsers: Vector[String],
users: Vector[BreakoutUser],
voiceUsers: Vector[BreakoutVoiceUser],
startedOn: Option[Long],
started: Boolean,
captureNotes: Boolean,
captureSlides: Boolean,
captureNotesFilename: String,
captureSlidesFilename: String,
allPages: Boolean,
presId: String,
sourcePresentationFilename: String,
) {
}

View File

@ -57,6 +57,7 @@ case class BreakoutRoomDetail(
viewerPassword: String,
sourcePresentationId: String,
sourcePresentationSlide: Int,
sourcePresentationFilename: String,
record: Boolean,
privateChatEnabled: Boolean,
captureNotes: Boolean,
@ -71,7 +72,7 @@ case class BreakoutRoomDetail(
object CreateBreakoutRoomsCmdMsg { val NAME = "CreateBreakoutRoomsCmdMsg" }
case class CreateBreakoutRoomsCmdMsg(header: BbbClientMsgHeader, body: CreateBreakoutRoomsCmdMsgBody) extends StandardMsg
case class CreateBreakoutRoomsCmdMsgBody(meetingId: String, durationInMinutes: Int, record: Boolean, captureNotes: Boolean, captureSlides: Boolean, rooms: Vector[BreakoutRoomMsgBody], sendInviteToModerators: Boolean)
case class BreakoutRoomMsgBody(name: String, sequence: Int, shortName: String, captureNotesFilename: String, captureSlidesFilename: String, isDefaultName: Boolean, freeJoin: Boolean, users: Vector[String], allPages: Boolean, presId: String)
case class BreakoutRoomMsgBody(name: String, sequence: Int, shortName: String, captureNotesFilename: String, captureSlidesFilename: String, isDefaultName: Boolean, freeJoin: Boolean, users: Vector[String], allPages: Boolean, presId: String, sourcePresentationFilename: String)
// Sent by user to request ending all the breakout rooms
object EndAllBreakoutRoomsMsg { val NAME = "EndAllBreakoutRoomsMsg" }

View File

@ -671,7 +671,9 @@ public class MeetingService implements MessageListener {
presDownloadService.extractPresentationPage(message.parentMeetingId,
message.sourcePresentationId,
message.sourcePresentationSlide, breakout.getInternalId());
message.sourcePresentationSlide,
breakout.getInternalId(),
message.sourcePresentationFilename);
} else {
Map<String, Object> logData = new HashMap<String, Object>();
logData.put("meetingId", message.meetingId);

View File

@ -17,6 +17,7 @@ public class CreateBreakoutRoom implements IMessage {
public final Integer durationInMinutes; // The duration of the breakout room
public final String sourcePresentationId;
public final Integer sourcePresentationSlide;
public final String sourcePresentationFilename;
public final Boolean record;
public final Boolean privateChatEnabled;
public final Boolean captureNotes; // Upload shared notes to main room after breakout room end
@ -38,6 +39,7 @@ public class CreateBreakoutRoom implements IMessage {
Integer duration,
String sourcePresentationId,
Integer sourcePresentationSlide,
String sourcePresentationFilename,
Boolean record,
Boolean privateChatEnabled,
Boolean captureNotes,
@ -58,6 +60,7 @@ public class CreateBreakoutRoom implements IMessage {
this.durationInMinutes = duration;
this.sourcePresentationId = sourcePresentationId;
this.sourcePresentationSlide = sourcePresentationSlide;
this.sourcePresentationFilename = sourcePresentationFilename;
this.record = record;
this.privateChatEnabled = privateChatEnabled;
this.captureNotes = captureNotes;

View File

@ -81,7 +81,8 @@ public class PresentationUrlDownloadService {
}
public void extractPresentationPage(final String sourceMeetingId, final String presentationId,
final Integer presentationSlide, final String destinationMeetingId) {
final Integer presentationSlide, final String destinationMeetingId,
final String sourcePresentationFilename) {
/**
* We delay processing of the presentation to make sure that the meeting has already been created.
* Otherwise, the meeting won't get the conversion events.
@ -89,18 +90,25 @@ public class PresentationUrlDownloadService {
ScheduledFuture scheduledFuture =
scheduledThreadPool.schedule(new Runnable() {
public void run() {
extractPage(sourceMeetingId, presentationId, presentationSlide, destinationMeetingId) ;
extractPage(sourceMeetingId, presentationId, presentationSlide, destinationMeetingId, sourcePresentationFilename) ;
}
}, 5, TimeUnit.SECONDS);
}
// A negative presentationSlide indicates the entire presentation deck should be used.
private void extractPage(final String sourceMeetingId, final String presentationId,
final Integer presentationSlide, final String destinationMeetingId) {
final Integer presentationSlide, final String destinationMeetingId,
final String sourcePresentationFilename) {
Boolean uploadFailed = false;
ArrayList<String> uploadFailedReasons = new ArrayList<String>();
// A negative presentationSlide indicates the entire presentation deck should be used.
Boolean extractWholePresentation = presentationSlide < 0;
String filenameWithoutExtension = FilenameUtils.removeExtension(sourcePresentationFilename);
// Append the slide number to the filename if a single slide is being extracted
String presentationSlideInFilename = extractWholePresentation ? "" : ("-" + presentationSlide.toString());
// Build the source meeting path
File sourceMeetingPath = new File(presentationDir + File.separatorChar
+ sourceMeetingId + File.separatorChar + sourceMeetingId
@ -137,7 +145,8 @@ public class PresentationUrlDownloadService {
}
// Build the target meeting path
String filenameExt = FilenameUtils.getExtension(sourcePresentationFile.getName());
String filename = sourcePresentationFile.getName();
String filenameExt = FilenameUtils.getExtension(filename);
String presId = Util.generatePresentationId(presentationId);
String newFilename = Util.createNewFilename(presId, filenameExt);
@ -147,7 +156,7 @@ public class PresentationUrlDownloadService {
+ newFilename;
File newPresentation = new File(newFilePath);
if (sourcePresentationFile.getName().toLowerCase().endsWith("pdf") && presentationSlide >= 0) {
if (sourcePresentationFile.getName().toLowerCase().endsWith("pdf") && !extractWholePresentation) {
pageExtractor.extractPage(sourcePresentationFile, new File(
newFilePath), presentationSlide);
} else {
@ -163,7 +172,7 @@ public class PresentationUrlDownloadService {
processUploadedFile("DEFAULT_PRESENTATION_POD",
destinationMeetingId,
presId,
"default-" + presentationSlide.toString() + "." + filenameExt,
filenameWithoutExtension + presentationSlideInFilename + "." + filenameExt,
newPresentation,
true,
"breakout-authz-token",

View File

@ -11,7 +11,7 @@ sealed trait ApiMsg
case class CreateBreakoutRoomMsg(meetingId: String, parentMeetingId: String,
name: String, sequence: Integer, freeJoin: Boolean, dialNumber: String,
voiceConfId: String, viewerPassword: String, moderatorPassword: String, duration: Int,
sourcePresentationId: String, sourcePresentationSlide: Int,
sourcePresentationId: String, sourcePresentationSlide: Int, sourcePresentationFilename: String,
record: Boolean, captureNotes: Boolean, captureSlides: Boolean, captureNotesFilename: String, captureSlidesFilename: String) extends ApiMsg
case class AddUserSession(token: String, session: UserSession)

View File

@ -101,6 +101,7 @@ class OldMeetingMsgHdlrActor(val olgMsgGW: OldMessageReceivedGW)
msg.body.room.durationInMinutes,
msg.body.room.sourcePresentationId,
msg.body.room.sourcePresentationSlide,
msg.body.room.sourcePresentationFilename,
msg.body.room.record,
msg.body.room.privateChatEnabled,
msg.body.room.captureNotes,

View File

@ -512,6 +512,9 @@ class BreakoutRoom extends PureComponent {
sequence: seq,
allPages: !this.getRoomPresentation(seq).startsWith(CURRENT_SLIDE_PREFIX),
presId: this.getRoomPresentation(seq).replace(CURRENT_SLIDE_PREFIX, ''),
sourcePresentationFilename: PresentationUploaderService.getPresentations()
.filter((pres) => pres.id == this.getRoomPresentation(seq).replace(CURRENT_SLIDE_PREFIX, ''))[0]
.filename || this.getRoomName(seq),
}));
createBreakoutRoom(rooms, durationTime, record, captureNotes, captureSlides, inviteMods);