Skip to content

Commit

Permalink
Merge pull request #18392 from antobinary/merge-july26
Browse files Browse the repository at this point in the history
chore: Merge 2.6.11 into 2.7
  • Loading branch information
antobinary committed Jul 27, 2023
2 parents 477f660 + 7be38fd commit 3c71afd
Show file tree
Hide file tree
Showing 14 changed files with 104 additions and 46 deletions.
2 changes: 1 addition & 1 deletion bbb-etherpad.placeholder.sh
@@ -1,2 +1,2 @@
git clone --branch 1.8.17 --depth 1 https://github.com/ether/etherpad-lite bbb-etherpad
git clone --branch 1.9.1 --depth 1 https://github.com/ether/etherpad-lite bbb-etherpad

2 changes: 1 addition & 1 deletion bbb-pads.placeholder.sh
@@ -1 +1 @@
git clone --branch v1.4.1 --depth 1 https://github.com/bigbluebutton/bbb-pads bbb-pads
git clone --branch v1.5.1 --depth 1 https://github.com/bigbluebutton/bbb-pads bbb-pads
2 changes: 1 addition & 1 deletion bbb-presentation-video.placeholder.sh
@@ -1,6 +1,6 @@
#!/bin/sh
set -ex
RELEASE=4.0.2
RELEASE=4.0.3
cat <<MSG
This tool downloads prebuilt packages built on Github Actions
The corresponding source can be browsed at https://github.com/bigbluebutton/bbb-presentation-video/tree/${RELEASE}
Expand Down
3 changes: 2 additions & 1 deletion bigbluebutton-config/bigbluebutton-release
@@ -1 +1,2 @@
BIGBLUEBUTTON_RELEASE=2.7.0-beta.2
BIGBLUEBUTTON_RELEASE=2.7.0-beta.3

25 changes: 25 additions & 0 deletions bigbluebutton-html5/imports/api/common/server/helpers.js
@@ -1,9 +1,34 @@
import Users from '/imports/api/users';
import Logger from '/imports/startup/server/logger';
import RegexWebUrl from '/imports/utils/regex-weburl';

const MSG_DIRECT_TYPE = 'DIRECT';
const NODE_USER = 'nodeJSapp';

const HTML_SAFE_MAP = {
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&#39;',
};

export const parseMessage = (message) => {
let parsedMessage = message || '';
parsedMessage = parsedMessage.trim();

// Replace <br/> with \n\r
parsedMessage = parsedMessage.replace(/<br\s*[\\/]?>/gi, '\n\r');

// Sanitize. See: http://shebang.brandonmintern.com/foolproof-html-escaping-in-javascript/
parsedMessage = parsedMessage.replace(/[<>'"]/g, (c) => HTML_SAFE_MAP[c]);

// Replace flash links to flash valid ones
parsedMessage = parsedMessage.replace(RegexWebUrl, "<a href='event:$&'><u>$&</u></a>");

return parsedMessage;
};


export const spokeTimeoutHandles = {};
export const clearSpokeTimeout = (meetingId, userId) => {
if (spokeTimeoutHandles[`${meetingId}-${userId}`]) {
Expand Down
@@ -1,32 +1,9 @@
import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import RedisPubSub from '/imports/startup/server/redis';
import RegexWebUrl from '/imports/utils/regex-weburl';
import { extractCredentials } from '/imports/api/common/server/helpers';
import Logger from '/imports/startup/server/logger';

const HTML_SAFE_MAP = {
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&#39;',
};

const parseMessage = (message) => {
let parsedMessage = message || '';
parsedMessage = parsedMessage.trim();

// Replace <br/> with \n\r
parsedMessage = parsedMessage.replace(/<br\s*[\\/]?>/gi, '\n\r');

// Sanitize. See: http://shebang.brandonmintern.com/foolproof-html-escaping-in-javascript/
parsedMessage = parsedMessage.replace(/[<>'"]/g, (c) => HTML_SAFE_MAP[c]);

// Replace flash links to flash valid ones
parsedMessage = parsedMessage.replace(RegexWebUrl, "<a href='event:$&'><u>$&</u></a>");

return parsedMessage;
};
import { extractCredentials, parseMessage } from '/imports/api/common/server/helpers';
import Logger from '/imports/startup/server/logger';

export default function sendGroupChatMsg(chatId, message) {
const REDIS_CONFIG = Meteor.settings.private.redis;
Expand Down
Expand Up @@ -2,7 +2,7 @@ import { GroupChatMsg } from '/imports/api/group-chat-msg';
import GroupChat from '/imports/api/group-chat';
import Logger from '/imports/startup/server/logger';
import flat from 'flat';
import { parseMessage } from './addGroupChatMsg';
import { parseMessage } from '/imports/api/common/server/helpers';

export default async function addBulkGroupChatMsgs(msgs) {
if (!msgs.length) return;
Expand Down
Expand Up @@ -2,7 +2,7 @@ import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import RedisPubSub from '/imports/startup/server/redis';
import Logger from '/imports/startup/server/logger';
import { extractCredentials } from '/imports/api/common/server/helpers';
import { extractCredentials, parseMessage } from '/imports/api/common/server/helpers';

const REDIS_CONFIG = Meteor.settings.private.redis;
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
Expand All @@ -16,8 +16,7 @@ export default function setGuestLobbyMessage(message) {

check(meetingId, String);
check(requesterUserId, String);

const payload = { message };
const payload = { message: parseMessage(message) };

Logger.info(`User=${requesterUserId} set guest lobby message to ${message}`);

Expand Down
Expand Up @@ -2,7 +2,8 @@ import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import RedisPubSub from '/imports/startup/server/redis';
import Logger from '/imports/startup/server/logger';
import { extractCredentials } from '/imports/api/common/server/helpers';
import { extractCredentials, parseMessage } from '/imports/api/common/server/helpers';


const REDIS_CONFIG = Meteor.settings.private.redis;
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
Expand All @@ -17,7 +18,7 @@ export default function setPrivateGuestLobbyMessage(message, guestId) {
check(meetingId, String);
check(requesterUserId, String);

const payload = { guestId, message };
const payload = { guestId, message: parseMessage(message) };

Logger.info(`User=${requesterUserId} sent a private guest lobby message to guest user=${guestId}`);

Expand Down
Expand Up @@ -51,7 +51,7 @@ const propTypes = {

const defaultProps = {
shortcuts: '',
tabIndex: 0,
tabIndex: -1,
};

const ChatListItem = (props) => {
Expand Down
Expand Up @@ -3,12 +3,15 @@ import PropTypes from 'prop-types';
import { TransitionGroup, CSSTransition } from 'react-transition-group';
import CaptionsListItem from '/imports/ui/components/user-list/captions-list-item/component';
import { defineMessages, injectIntl } from 'react-intl';
import KEY_CODES from '/imports/utils/keyCodes';
import Styled from './styles';
import { findDOMNode } from 'react-dom';

const propTypes = {
ownedLocales: PropTypes.arrayOf(PropTypes.object).isRequired,
sidebarContentPanel: PropTypes.string.isRequired,
layoutContextDispatch: PropTypes.func.isRequired,
roving: PropTypes.func.isRequired,
};

const intlMessages = defineMessages({
Expand All @@ -19,13 +22,62 @@ const intlMessages = defineMessages({
});

class UserCaptions extends Component {
constructor() {
super();

this.state = {
selectedCaption: null,
};

this.activeCaptionRefs = [];

this.changeState = this.changeState.bind(this);
this.rove = this.rove.bind(this);
}

componentDidMount() {
if (this._captionsList) {
this._captionsList.addEventListener(
'keydown',
this.rove,
true,
);
}
}

componentDidUpdate(prevProps, prevState) {
const { selectedCaption } = this.state;
if (selectedCaption && selectedCaption !== prevState.selectedCaption) {
const { firstChild } = selectedCaption;
if (firstChild) firstChild.focus();
}
}

changeState(ref) {
this.setState({ selectedCaption: ref });
}

rove(event) {
const { roving } = this.props;
const { selectedCaption } = this.state;
const captionItemsRef = findDOMNode(this._captionItems);
if ([KEY_CODES.SPACE, KEY_CODES.ENTER].includes(event?.which)) {
selectedCaption?.firstChild?.click();
} else {
roving(event, this.changeState, captionItemsRef, selectedCaption);
}
event.stopPropagation();
}

renderCaptions() {
const {
ownedLocales,
sidebarContentPanel,
layoutContextDispatch,
} = this.props;

let index = -1;

return ownedLocales.map((ownedLocale) => (
<CSSTransition
classNames="transition"
Expand All @@ -36,7 +88,7 @@ class UserCaptions extends Component {
component="div"
key={ownedLocale.locale}
>
<Styled.ListTransition>
<Styled.ListTransition ref={(node) => { this.activeCaptionRefs[index += 1] = node; }}>
<CaptionsListItem
{...{
locale: ownedLocale.locale,
Expand Down Expand Up @@ -69,10 +121,10 @@ class UserCaptions extends Component {
<Styled.ScrollableList
role="tabpanel"
tabIndex={0}
ref={(ref) => { this._msgsList = ref; }}
ref={(ref) => { this._captionsList = ref; }}
>
<Styled.List>
<TransitionGroup ref={(ref) => { this._msgItems = ref; }}>
<TransitionGroup ref={(ref) => { this._captionItems = ref; }}>
{this.renderCaptions()}
</TransitionGroup>
</Styled.List>
Expand Down
@@ -1,15 +1,16 @@
import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import UserCaptionsItem from './component';
import Service from '/imports/ui/components/user-list/service';
import CaptionsService from '/imports/ui/components/captions/service';
import { layoutSelectInput, layoutDispatch } from '../../../layout/context';

const Container = (props) => {
const sidebarContent = layoutSelectInput((i) => i.sidebarContent);
const { sidebarContentPanel } = sidebarContent;
const layoutContextDispatch = layoutDispatch();

return <UserCaptionsItem {...{ sidebarContentPanel, layoutContextDispatch, ...props }} />;
const { roving } = Service;
return <UserCaptionsItem {...{ sidebarContentPanel, layoutContextDispatch, roving, ...props }} />;
};

export default withTracker(() => ({
Expand Down
Expand Up @@ -47,13 +47,13 @@ class UserMessages extends PureComponent {
this._msgsList.addEventListener(
'keydown',
this.rove,
true,
);
}
}

componentDidUpdate(prevProps, prevState) {
const { selectedChat } = this.state;

if (selectedChat && selectedChat !== prevState.selectedChat) {
const { firstChild } = selectedChat;
if (firstChild) firstChild.focus();
Expand Down Expand Up @@ -97,6 +97,7 @@ class UserMessages extends PureComponent {
const { selectedChat } = this.state;
const msgItemsRef = findDOMNode(this._msgItems);
roving(event, this.changeState, msgItemsRef, selectedChat);
event.stopPropagation();
}

render() {
Expand All @@ -120,7 +121,7 @@ class UserMessages extends PureComponent {
</Styled.Container>
<Styled.ScrollableList
role="tabpanel"
tabIndex={-1}
tabIndex={0}
ref={(ref) => { this._msgsList = ref; }}
>
<Styled.List>
Expand Down
7 changes: 4 additions & 3 deletions build/packages-template/bbb-etherpad/settings.json
Expand Up @@ -220,9 +220,10 @@
*/

/*
* The default text of a pad
*/
"defaultPadText" : "",
* The default text of a pad: A zero-width-space is used to work around an issue with Etherpad 1.9.1 where empty pads are not being created.
* See: https://github.com/ether/etherpad-lite/issues/5787
*/
"defaultPadText" : "\u200b",

/*
* Default Pad behavior.
Expand Down

0 comments on commit 3c71afd

Please sign in to comment.