diff --git a/src/utils/exportUtils.js b/src/utils/exportUtils.js
index f784c48f8f..1954d64467 100644
--- a/src/utils/exportUtils.js
+++ b/src/utils/exportUtils.js
@@ -58,7 +58,7 @@ const getTimelineConversation = (room) => {
if (!timelineWindow.canPaginate('f')) {
events.push(...timelineSet.getPendingEvents());
}
-
+ console.log(events);
return events;
};
@@ -307,19 +307,13 @@ const userColors = [
"#ff8c44",
];
-const createDiv = (content, id, ...classNames) => {
- return `
${!joined ? `
@@ -328,35 +322,35 @@ const createBody = (event, joined = false) => {
` : ``}
-
${new Date(event._localTimestamp).toLocaleTimeString().slice(0, -3)}
+
${new Date(event.getTs()).toLocaleTimeString().slice(0, -3)}
${!joined ? `
${event.sender.name}
`: ``}
+ ${isReply ?
+ `
`: ``}
${event.getContent().body}
`;
};
-const replyAnchor = (eventId) => {
- return `
- ${new Date(event._localTimestamp)
+ ${new Date(event.getTs())
.toLocaleString("en-us", {year: "numeric", month: "long", day: "numeric" })}
@@ -370,11 +364,11 @@ const createHTML = (events, room) => {
let prevEvent = null;
for (const event of events) {
content += dateSeparator(event, prevEvent);
- if (event.getContent().msgtype === "m.text") {
+ if (event.getType() === "m.room.message") {
const shouldBeJoined = prevEvent && prevEvent.getContent().msgtype === "m.text"
&& event.sender.userId === prevEvent.sender.userId && !dateSeparator(event, prevEvent);
- const body = createBody(event, shouldBeJoined);
+ const body = createMessageBody(event, shouldBeJoined, !!replyId(event), replyId(event));
content += body;
} else {
@@ -394,8 +388,8 @@ const createHTML = (events, room) => {
const exportConversationalHistory = async (room) => {
const res = getTimelineConversation(room);
- const html = createHTML(res, room);
const zip = new JSZip();
+ const html = createHTML(res, room);
zip.file("css/style.css", css);
zip.file("index.html", html);
const filename = `matrix-export-${new Date().toISOString()}.zip`;