Merge branch 'antobinary-patch-2' of github.com:bigbluebutton/bigbluebutton into open-cc

This commit is contained in:
Lucas Fialho Zawacki 2023-02-01 17:30:39 -03:00
commit 9cabb69eb8
9 changed files with 70 additions and 45 deletions

View File

@ -28,6 +28,7 @@ import java.io.BufferedReader;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.net.URLConnection;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Collections; import java.util.Collections;
@ -96,11 +97,12 @@ public final class SupportedFileTypes {
* But none of them was as successful as the linux based command * But none of them was as successful as the linux based command
*/ */
public static String detectMimeType(File pres) { public static String detectMimeType(File pres) {
String mimeType = "";
if (pres != null && pres.isFile()){
try { try {
if (pres == null) throw new NullPointerException("Presentation is null");
if (!pres.isFile()) throw new RuntimeException("Presentation is not a file");
ProcessBuilder processBuilder = new ProcessBuilder(); ProcessBuilder processBuilder = new ProcessBuilder();
processBuilder.command("bash", "-c", "file -b --mime-type " + pres.getAbsolutePath()); processBuilder.command("bash", "-c", "file -b --mime-type \"" + pres.getAbsolutePath() + "\"");
Process process = processBuilder.start(); Process process = processBuilder.start();
StringBuilder output = new StringBuilder(); StringBuilder output = new StringBuilder();
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
@ -110,28 +112,49 @@ public final class SupportedFileTypes {
} }
int exitVal = process.waitFor(); int exitVal = process.waitFor();
if (exitVal == 0) { if (exitVal == 0) {
mimeType = output.toString().trim(); return output.toString().trim();
} else { } else {
log.error("Error while executing command {} for file {}, error: {}", String executedCommand = processBuilder.command().toArray(new String[0])[2];
process.toString(), pres.getAbsolutePath(), process.getErrorStream());
} //Read error stream
} catch (IOException e) { BufferedReader stdError = new BufferedReader(new InputStreamReader(process.getErrorStream()));
log.error("Could not read file [{}]", pres.getAbsolutePath(), e.getMessage()); StringBuilder errorString = new StringBuilder();
} catch (InterruptedException e) { while (stdError.ready()) {
log.error("Flow interrupted for file [{}]", pres.getAbsolutePath(), e.getMessage()); errorString.append(stdError.readLine());
if (stdError.ready()) {
errorString.append("\n");
} }
} }
return mimeType;
log.error("Error while executing command '{}': {}", executedCommand, errorString);
if (exitVal == 127) {
// 127 - command not found
// use Java method to detect in this case (based on file name)
return URLConnection.getFileNameMap().getContentTypeFor(pres.getAbsolutePath());
} else {
throw new RuntimeException(errorString.toString());
}
}
} catch (Exception e) {
log.error("Error while executing detectMimeType: {}", e.getMessage());
}
return "";
} }
public static Boolean isPresentationMimeTypeValid(File pres, String fileExtension) { public static Boolean isPresentationMimeTypeValid(File pres, String fileExtension) {
String mimeType = detectMimeType(pres); String mimeType = detectMimeType(pres);
if(mimeType == null || mimeType == "") return false; if (mimeType == null || mimeType.equals("")) {
return false;
}
if(!mimeTypeUtils.getValidMimeTypes().contains(mimeType)) return false; if (!mimeTypeUtils.getValidMimeTypes().contains(mimeType)) {
return false;
}
if(!mimeTypeUtils.extensionMatchMimeType(mimeType, fileExtension)) { if (!mimeTypeUtils.extensionMatchMimeType(mimeType, fileExtension)) {
log.error("File with extension [{}] doesn't match with mimeType [{}].", fileExtension, mimeType); log.error("File with extension [{}] doesn't match with mimeType [{}].", fileExtension, mimeType);
return false; return false;
} }

View File

@ -1 +1 @@
git clone --branch v5.0.0-beta.2 --depth 1 https://github.com/bigbluebutton/bbb-playback bbb-playback git clone --branch v5.0.0-rc.1 --depth 1 https://github.com/bigbluebutton/bbb-playback bbb-playback

View File

@ -1 +1 @@
BIGBLUEBUTTON_RELEASE=2.6.0-rc.1 BIGBLUEBUTTON_RELEASE=2.6.0-rc.2

View File

@ -148,7 +148,7 @@ class Polling extends Component {
{answers.map((pollAnswer) => { {answers.map((pollAnswer) => {
const formattedMessageIndex = pollAnswer?.key?.toLowerCase(); const formattedMessageIndex = pollAnswer?.key?.toLowerCase();
let label = pollAnswer.key; let label = pollAnswer.key;
if (defaultPoll && pollAnswerIds[formattedMessageIndex]) { if ((defaultPoll || pollType.includes('CUSTOM')) && pollAnswerIds[formattedMessageIndex]) {
label = intl.formatMessage(pollAnswerIds[formattedMessageIndex]); label = intl.formatMessage(pollAnswerIds[formattedMessageIndex]);
} }

View File

@ -18,7 +18,7 @@ export default (props) => {
timeout={{ enter: 400 }} timeout={{ enter: 400 }}
> >
<Styled.Content animations={animations}> <Styled.Content animations={animations}>
<Styled.DefaultContent hideContent={autoSwapLayout && hidePresentation}> <Styled.DefaultContent hideContent={hidePresentation}>
<p> <p>
<FormattedMessage <FormattedMessage
id="app.home.greeting" id="app.home.greeting"

View File

@ -83,7 +83,7 @@ const parseCurrentSlideContent = (yesValue, noValue, abstentionValue, trueValue,
content, content,
} = currentSlide; } = currentSlide;
const questionRegex = /.*?\?$/gm; const questionRegex = /.*?\?/gm;
const question = safeMatch(questionRegex, content, ''); const question = safeMatch(questionRegex, content, '');
const doubleQuestionRegex = /\?{2}/gm; const doubleQuestionRegex = /\?{2}/gm;
@ -95,6 +95,11 @@ const parseCurrentSlideContent = (yesValue, noValue, abstentionValue, trueValue,
const pollRegex = /[1-9A-Ia-i][.)].*/g; const pollRegex = /[1-9A-Ia-i][.)].*/g;
let optionsPoll = safeMatch(pollRegex, content, []); let optionsPoll = safeMatch(pollRegex, content, []);
const optionsWithLabels = []; const optionsWithLabels = [];
if (hasYN) {
optionsPoll = ['yes', 'no'];
}
if (optionsPoll) { if (optionsPoll) {
optionsPoll = optionsPoll.map((opt) => { optionsPoll = optionsPoll.map((opt) => {
const MAX_CHAR_LIMIT = 30; const MAX_CHAR_LIMIT = 30;

View File

@ -424,7 +424,7 @@ export default function Whiteboard(props) {
if (prevFitToWidth !== null && fitToWidth !== prevFitToWidth) { if (prevFitToWidth !== null && fitToWidth !== prevFitToWidth) {
const zoom = calculateZoom(slidePosition.width, slidePosition.height) const zoom = calculateZoom(slidePosition.width, slidePosition.height)
tldrawAPI?.setCamera([0, 0], zoom); tldrawAPI?.setCamera([0, 0], zoom);
const viewedRegionH = SlideCalcUtil.calcViewedRegionHeight(tldrawAPI?.viewport.width, slidePosition.height); const viewedRegionH = SlideCalcUtil.calcViewedRegionHeight(tldrawAPI?.viewport.height, slidePosition.height);
setZoom(HUNDRED_PERCENT); setZoom(HUNDRED_PERCENT);
zoomChanger(HUNDRED_PERCENT); zoomChanger(HUNDRED_PERCENT);
zoomSlide(parseInt(curPageId), podId, HUNDRED_PERCENT, viewedRegionH, 0, 0); zoomSlide(parseInt(curPageId), podId, HUNDRED_PERCENT, viewedRegionH, 0, 0);
@ -508,13 +508,13 @@ export default function Whiteboard(props) {
if (fitToWidth) { if (fitToWidth) {
const zoom = calculateZoom(slidePosition.width, slidePosition.height) const zoom = calculateZoom(slidePosition.width, slidePosition.height)
tldrawAPI?.setCamera([0, 0], zoom); tldrawAPI?.setCamera([0, 0], zoom);
const viewedRegionH = SlideCalcUtil.calcViewedRegionHeight(tldrawAPI?.viewport.width, slidePosition.height); const viewedRegionH = SlideCalcUtil.calcViewedRegionHeight(tldrawAPI?.viewport.height, slidePosition.height);
zoomSlide(parseInt(curPageId), podId, HUNDRED_PERCENT, viewedRegionH, 0, 0); zoomSlide(parseInt(curPageId), podId, HUNDRED_PERCENT, viewedRegionH, 0, 0);
setZoom(HUNDRED_PERCENT); setZoom(HUNDRED_PERCENT);
zoomChanger(HUNDRED_PERCENT); zoomChanger(HUNDRED_PERCENT);
} else if (!isMounting) { } else if (!isMounting) {
let viewedRegionW = SlideCalcUtil.calcViewedRegionWidth(tldrawAPI?.viewport.height, slidePosition.width); let viewedRegionW = SlideCalcUtil.calcViewedRegionWidth(tldrawAPI?.viewport.width, slidePosition.width);
let viewedRegionH = SlideCalcUtil.calcViewedRegionHeight(tldrawAPI?.viewport.width, slidePosition.height); let viewedRegionH = SlideCalcUtil.calcViewedRegionHeight(tldrawAPI?.viewport.height, slidePosition.height);
const camera = tldrawAPI?.getPageState()?.camera; const camera = tldrawAPI?.getPageState()?.camera;
const zoomFitSlide = calculateZoom(slidePosition.width, slidePosition.height); const zoomFitSlide = calculateZoom(slidePosition.width, slidePosition.height);
if (!fitToWidth && camera.zoom === zoomFitSlide) { if (!fitToWidth && camera.zoom === zoomFitSlide) {
@ -679,8 +679,8 @@ export default function Whiteboard(props) {
isPresenter && zoomChanger(zoomToolbar); isPresenter && zoomChanger(zoomToolbar);
} }
let viewedRegionW = SlideCalcUtil.calcViewedRegionWidth(tldrawAPI?.viewport.height, slidePosition.width); let viewedRegionW = SlideCalcUtil.calcViewedRegionWidth(tldrawAPI?.viewport.width, slidePosition.width);
let viewedRegionH = SlideCalcUtil.calcViewedRegionHeight(tldrawAPI?.viewport.width, slidePosition.height); let viewedRegionH = SlideCalcUtil.calcViewedRegionHeight(tldrawAPI?.viewport.height, slidePosition.height);
if (!fitToWidth && camera.zoom === zoomFitSlide) { if (!fitToWidth && camera.zoom === zoomFitSlide) {
viewedRegionW = HUNDRED_PERCENT; viewedRegionW = HUNDRED_PERCENT;
@ -805,7 +805,7 @@ export default function Whiteboard(props) {
const webcams = document.getElementById('cameraDock'); const webcams = document.getElementById('cameraDock');
const dockPos = webcams?.getAttribute("data-position"); const dockPos = webcams?.getAttribute("data-position");
if(currentTool) tldrawAPI?.selectTool(currentTool); if (currentTool && !isPanning) tldrawAPI?.selectTool(currentTool);
const editableWB = ( const editableWB = (
<EditableWBWrapper> <EditableWBWrapper>

View File

@ -247,7 +247,7 @@
"app.presentationUploader.exportingTimeout": "L'export dure trop longtemps...", "app.presentationUploader.exportingTimeout": "L'export dure trop longtemps...",
"app.presentationUploader.export": "Envoi dans la discussion", "app.presentationUploader.export": "Envoi dans la discussion",
"app.presentationUploader.export.linkAvailable": "Le lien de téléchargement {0} est disponible dans la discussion publique", "app.presentationUploader.export.linkAvailable": "Le lien de téléchargement {0} est disponible dans la discussion publique",
"app.presentationUploader.export.notAccessibleWarning": "peut ne pas être accessible", "app.presentationUploader.export.notAccessibleWarning": "Probablement non conforme aux règles d'accessibilité",
"app.presentationUploader.currentPresentationLabel": "Présentation courante", "app.presentationUploader.currentPresentationLabel": "Présentation courante",
"app.presentationUploder.extraHint": "IMPORTANT: Le volume d'un fichier ne doit pas excéder {0} MB et {1} pages.", "app.presentationUploder.extraHint": "IMPORTANT: Le volume d'un fichier ne doit pas excéder {0} MB et {1} pages.",
"app.presentationUploder.uploadLabel": "Télécharger", "app.presentationUploder.uploadLabel": "Télécharger",
@ -266,6 +266,7 @@
"app.presentationUploder.rejectedError": "Le(s) fichier(s) sélectionné(s) a (ont) été rejeté()s. Veuillez vérifier leur format.", "app.presentationUploder.rejectedError": "Le(s) fichier(s) sélectionné(s) a (ont) été rejeté()s. Veuillez vérifier leur format.",
"app.presentationUploder.connectionClosedError": "Interruption due à une connectivité faible. Veuillez essayer à nouveau.", "app.presentationUploder.connectionClosedError": "Interruption due à une connectivité faible. Veuillez essayer à nouveau.",
"app.presentationUploder.upload.progress": "Chargement ({0}%)", "app.presentationUploder.upload.progress": "Chargement ({0}%)",
"app.presentationUploder.conversion.204": "Pas de contenu a capturer",
"app.presentationUploder.upload.413": "Le fichier est trop volumineux, il dépasse le maximum de {0} Mo", "app.presentationUploder.upload.413": "Le fichier est trop volumineux, il dépasse le maximum de {0} Mo",
"app.presentationUploder.genericError": "Oups, quelque chose s'est mal passé...", "app.presentationUploder.genericError": "Oups, quelque chose s'est mal passé...",
"app.presentationUploder.upload.408": "Le jeton de demande de téléversement a expiré.", "app.presentationUploder.upload.408": "Le jeton de demande de téléversement a expiré.",
@ -915,6 +916,7 @@
"app.connection-status.no": "Non", "app.connection-status.no": "Non",
"app.connection-status.notification": "Une perte de votre connexion a été détectée", "app.connection-status.notification": "Une perte de votre connexion a été détectée",
"app.connection-status.offline": "Hors ligne", "app.connection-status.offline": "Hors ligne",
"app.connection-status.clientNotRespondingWarning": "Le client ne répond pas",
"app.connection-status.audioUploadRate": "Taux d'envoi audio", "app.connection-status.audioUploadRate": "Taux d'envoi audio",
"app.connection-status.audioDownloadRate": "Taux de réception audio", "app.connection-status.audioDownloadRate": "Taux de réception audio",
"app.connection-status.videoUploadRate": "Taux d'envoi vidéo", "app.connection-status.videoUploadRate": "Taux d'envoi vidéo",

View File

@ -21,17 +21,12 @@ bbb-freeswitch-core
bbb-freeswitch-sounds bbb-freeswitch-sounds
bbb-fsesl-akka bbb-fsesl-akka
bbb-html5 bbb-html5
bbb-html5-nodejs
bbb-learning-dashboard bbb-learning-dashboard
bbb-libreoffice-docker bbb-libreoffice-docker
bbb-mkclean bbb-mkclean
bbb-pads bbb-pads
bbb-playback bbb-playback
bbb-playback-notes
bbb-playback-presentation bbb-playback-presentation
bbb-playback-podcast
bbb-playback-screenshare
bbb-playback-video
bbb-record-core bbb-record-core
bbb-web bbb-web
bbb-webrtc-sfu" bbb-webrtc-sfu"