Delint
This commit is contained in:
parent
1ed316851a
commit
6dd3631a17
5 changed files with 22 additions and 23 deletions
|
@ -125,7 +125,6 @@ export function presentableTextForFile(content: IContent, withSize = true): stri
|
||||||
interface IProps extends IBodyProps {
|
interface IProps extends IBodyProps {
|
||||||
/* whether or not to show the default placeholder for the file. Defaults to true. */
|
/* whether or not to show the default placeholder for the file. Defaults to true. */
|
||||||
showGenericPlaceholder: boolean;
|
showGenericPlaceholder: boolean;
|
||||||
forExport?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IState {
|
interface IState {
|
||||||
|
|
|
@ -63,7 +63,7 @@ export default class HTMLExporter extends Exporter {
|
||||||
name={this.room.name}
|
name={this.room.name}
|
||||||
title={this.room.name}
|
title={this.room.name}
|
||||||
url={blob ? avatarPath : null}
|
url={blob ? avatarPath : null}
|
||||||
resizeMethod={"crop"}
|
resizeMethod="crop"
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
return renderToStaticMarkup(avatar);
|
return renderToStaticMarkup(avatar);
|
||||||
|
@ -232,7 +232,7 @@ export default class HTMLExporter extends Exporter {
|
||||||
return renderToStaticMarkup(dateSeparator);
|
return renderToStaticMarkup(dateSeparator);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected _wantsDateSeparator(event: MatrixEvent, prevEvent: MatrixEvent) {
|
protected needsDateSeparator(event: MatrixEvent, prevEvent: MatrixEvent) {
|
||||||
if (prevEvent == null) return true;
|
if (prevEvent == null) return true;
|
||||||
return wantsDateSeparator(prevEvent.getDate(), event.getDate());
|
return wantsDateSeparator(prevEvent.getDate(), event.getDate());
|
||||||
}
|
}
|
||||||
|
@ -341,8 +341,8 @@ export default class HTMLExporter extends Exporter {
|
||||||
if (this.cancelled) return this.cleanUp();
|
if (this.cancelled) return this.cleanUp();
|
||||||
if (!haveTileForEvent(event)) continue;
|
if (!haveTileForEvent(event)) continue;
|
||||||
|
|
||||||
content += this._wantsDateSeparator(event, prevEvent) ? this.getDateSeparator(event) : "";
|
content += this.needsDateSeparator(event, prevEvent) ? this.getDateSeparator(event) : "";
|
||||||
const shouldBeJoined = !this._wantsDateSeparator(event, prevEvent)
|
const shouldBeJoined = !this.needsDateSeparator(event, prevEvent)
|
||||||
&& shouldFormContinuation(prevEvent, event, false);
|
&& shouldFormContinuation(prevEvent, event, false);
|
||||||
const body = await this.createMessageBody(event, shouldBeJoined);
|
const body = await this.createMessageBody(event, shouldBeJoined);
|
||||||
this.totalSize += Buffer.byteLength(body);
|
this.totalSize += Buffer.byteLength(body);
|
||||||
|
|
|
@ -59,7 +59,7 @@ export default class PlainTextExporter extends Exporter {
|
||||||
return `<${rplName}${rplSource}> ${rplText}`;
|
return `<${rplName}${rplSource}> ${rplText}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
protected _textForEvent = async (mxEv: MatrixEvent) => {
|
protected plainTextForEvent = async (mxEv: MatrixEvent) => {
|
||||||
const senderDisplayName = mxEv.sender && mxEv.sender.name ? mxEv.sender.name : mxEv.getSender();
|
const senderDisplayName = mxEv.sender && mxEv.sender.name ? mxEv.sender.name : mxEv.getSender();
|
||||||
let mediaText = "";
|
let mediaText = "";
|
||||||
if (this.isAttachment(mxEv)) {
|
if (this.isAttachment(mxEv)) {
|
||||||
|
@ -94,7 +94,7 @@ export default class PlainTextExporter extends Exporter {
|
||||||
this.updateProgress(`Processing event ${i + 1} out of ${events.length}`, false, true);
|
this.updateProgress(`Processing event ${i + 1} out of ${events.length}`, false, true);
|
||||||
if (this.cancelled) return this.cleanUp();
|
if (this.cancelled) return this.cleanUp();
|
||||||
if (!haveTileForEvent(event)) continue;
|
if (!haveTileForEvent(event)) continue;
|
||||||
const textForEvent = await this._textForEvent(event);
|
const textForEvent = await this.plainTextForEvent(event);
|
||||||
content += textForEvent && `${new Date(event.getTs()).toLocaleString()} - ${textForEvent}\n`;
|
content += textForEvent && `${new Date(event.getTs()).toLocaleString()} - ${textForEvent}\n`;
|
||||||
}
|
}
|
||||||
return content;
|
return content;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue