Create a basic HTML export tool with support only for text based events

This commit is contained in:
Jaiwanth 2021-05-19 17:31:52 +05:30
parent cf384c2a54
commit ebdb340a5c
5 changed files with 488 additions and 1 deletions

View file

@ -32,6 +32,8 @@ import RoomTopic from "../elements/RoomTopic";
import RoomName from "../elements/RoomName";
import {PlaceCallType} from "../../../CallHandler";
import {replaceableComponent} from "../../../utils/replaceableComponent";
import exportConversationalHistory from '../../../utils/exportUtils';
@replaceableComponent("views.rooms.RoomHeader")
export default class RoomHeader extends React.Component {
@ -117,6 +119,10 @@ export default class RoomHeader extends React.Component {
return !(currentPinEvent.getContent().pinned && currentPinEvent.getContent().pinned.length <= 0);
}
_exportConvertionalHistory = async () => {
exportConversationalHistory(this.props.room);
}
render() {
let searchStatus = null;
let cancelButton = null;
@ -244,8 +250,14 @@ export default class RoomHeader extends React.Component {
title={_t("Video call")} />;
}
const exportButton = <AccessibleTooltipButton
className="mx_RoomHeader_button mx_ImageView_button_download"
onClick={this._exportConvertionalHistory}
title={_t("Export conversation")} />;
const rightRow =
<div className="mx_RoomHeader_buttons">
{ exportButton }
{ videoCallButton }
{ voiceCallButton }
{ pinnedEventsButton }