Skip to content
Snippets Groups Projects
Commit 25bf0096 authored by Tainan Felipe's avatar Tainan Felipe
Browse files

Add field to toggle the download of the public chat message

parent 93c9aeca
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,9 @@ const intlMessages = defineMessages({
},
});
const CHAT_CONFIG = Meteor.settings.public.chat;
const ENABLE_SAVE_AND_COPY_PUBLIC_CHAT = CHAT_CONFIG.enableSaveAndCopyPublicChat;
class ChatDropdown extends PureComponent {
constructor(props) {
super(props);
......@@ -82,13 +85,21 @@ class ChatDropdown extends PureComponent {
getAvailableActions() {
const {
intl, isMeteorConnected, amIModerator, meetingIsBreakout, meetingName, timeWindowsValues, users,
intl,
isMeteorConnected,
amIModerator,
meetingIsBreakout,
meetingName,
timeWindowsValues,
users,
} = this.props;
const clearIcon = 'delete';
const saveIcon = 'download';
const copyIcon = 'copy';
return _.compact([
ENABLE_SAVE_AND_COPY_PUBLIC_CHAT
&& (
<DropdownListItem
data-test="chatSave"
icon={saveIcon}
......@@ -103,19 +114,23 @@ class ChatDropdown extends PureComponent {
link.setAttribute('download', `bbb-${meetingName}[public-chat]_${dateString}.txt`);
link.setAttribute(
'href',
`data: ${mimeType} ;charset=utf-8,`+
`${encodeURIComponent(ChatService.exportChat(timeWindowsValues, users, intl))}`,
`data: ${mimeType} ;charset=utf-8,`
+ `${encodeURIComponent(ChatService.exportChat(timeWindowsValues, users, intl))}`,
);
link.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }));
}}
/>,
/>
),
ENABLE_SAVE_AND_COPY_PUBLIC_CHAT
&& (
<DropdownListItem
data-test="chatCopy"
icon={copyIcon}
id="clipboardButton"
label={intl.formatMessage(intlMessages.copy)}
key={this.actionsKey[1]}
/>,
/>
),
!meetingIsBreakout && amIModerator && isMeteorConnected ? (
<DropdownListItem
data-test="chatClear"
......
......@@ -396,6 +396,7 @@ public:
enabled: true
itemsPerPage: 100
timeBetweenFetchs: 1000
enableSaveAndCopyPublicChat: false
bufferChatInsertsMs: 0
startClosed: false
min_message_length: 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment