Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Export Conversations #6081

Merged
merged 207 commits into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
207 commits
Select commit Hold shift + click to select a range
ebdb340
Create a basic HTML export tool with support only for text based events
jaiwanth-v May 19, 2021
16c55ba
Use ts instead of age
jaiwanth-v May 21, 2021
cea60ef
Handle reply checking for encrypted messages
jaiwanth-v May 21, 2021
2676e61
Embed avatar and chat images into HTML
jaiwanth-v May 21, 2021
e59f238
Minor UI changes
jaiwanth-v May 21, 2021
dfb7aa4
Refactor, move HTML export to a new file and switch to TypeScript
jaiwanth-v May 22, 2021
0bf65da
Remove unnecessary semicolons
jaiwanth-v May 22, 2021
a47117e
Do not process edit events as they are already considered
jaiwanth-v May 22, 2021
bb81515
Use matrix style class names, modify CSS and some small changes
jaiwanth-v May 22, 2021
e3b0d89
Add some colours
jaiwanth-v May 22, 2021
3147ace
Switch completely to TypeScript, updated userColors
jaiwanth-v May 24, 2021
0029bf5
Small correction
jaiwanth-v May 24, 2021
e6c4ab3
Use classes instead of loosely defined functions, use prebuilt functi…
jaiwanth-v May 24, 2021
1ee6e42
Add await
jaiwanth-v May 24, 2021
136b6db
Add an abstract exporter base class
jaiwanth-v May 24, 2021
43a111d
Return blob from export
jaiwanth-v May 24, 2021
7cd3f51
indent and use double quotes
jaiwanth-v May 25, 2021
0ee2906
Add support for firefox
jaiwanth-v May 25, 2021
0b728ff
Use double quotes for import
jaiwanth-v May 25, 2021
7286aa2
Handle audio and video files
jaiwanth-v May 26, 2021
334b7ef
Implement animated scroll to base event for replies
jaiwanth-v May 26, 2021
60ef6f9
Add emote support and show a toast if the message isn't exported
jaiwanth-v May 27, 2021
573a3ca
Rewrite export tool to use existing components to render output, use …
jaiwanth-v May 31, 2021
409213c
Remove conditional
jaiwanth-v May 31, 2021
59c1b67
Enable support for image, video and audio files
jaiwanth-v May 31, 2021
fa073cd
Save and display room avatars
jaiwanth-v May 31, 2021
28a1a55
Save users' avatars
jaiwanth-v May 31, 2021
5f1c9d0
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
jaiwanth-v May 31, 2021
01284ef
Handle encrypted voice messages
jaiwanth-v May 31, 2021
a0a6046
Handle non-media attachments
jaiwanth-v May 31, 2021
80c0ad8
Better file names
jaiwanth-v Jun 1, 2021
395b6ba
Small refactor
jaiwanth-v Jun 1, 2021
5f9cf57
Fix untracked files
jaiwanth-v Jun 1, 2021
1382bd4
Handle icons and skip decryption checks during export
jaiwanth-v Jun 1, 2021
9c38af0
Make reply UI work even when javascript is disabled
jaiwanth-v Jun 1, 2021
fc61e96
Remove unnecessary export
jaiwanth-v Jun 1, 2021
01a3b85
Add sticker support
jaiwanth-v Jun 1, 2021
c63c59b
Rename date function
jaiwanth-v Jun 1, 2021
692e499
Handle encrypted stickers and store stickers in a separate folder
jaiwanth-v Jun 2, 2021
f84ae4a
Add await
jaiwanth-v Jun 2, 2021
183166c
Unminify CSS and apply suggestions from the design team
jaiwanth-v Jun 3, 2021
4c22d1f
Refactor
jaiwanth-v Jun 3, 2021
e7f0df7
Small fix
jaiwanth-v Jun 3, 2021
f32726d
Begin extended implementation
jaiwanth-v Jun 4, 2021
8786c97
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
jaiwanth-v Jun 5, 2021
56488d2
Modify the process for setting event metadata and refactor
jaiwanth-v Jun 7, 2021
2b432a7
Add markdown CSS
jaiwanth-v Jun 7, 2021
b68ea48
Explicitly declare cli and use alt attribute for images
jaiwanth-v Jun 7, 2021
0f06f1b
Replace map with for loop
jaiwanth-v Jun 7, 2021
9e298e9
Add logs and unload listener
jaiwanth-v Jun 8, 2021
6f8c163
isExporting -> forExport and wrap EventTile with Context Provider
jaiwanth-v Jun 8, 2021
0f6d09a
Update src/utils/exportUtils/Exporter.ts
jaiwanth-v Jun 8, 2021
03d8e1f
Update src/utils/exportUtils/Exporter.ts
jaiwanth-v Jun 8, 2021
d80e008
Update src/utils/exportUtils/Exporter.ts
jaiwanth-v Jun 8, 2021
dbb3614
Merge branch 'develop' into export-conversations
jaiwanth-v Jun 8, 2021
573abab
Get rid of mediaSrc and avatarSrc props
jaiwanth-v Jun 9, 2021
716e2ef
Enable proper i18n for date utils
jaiwanth-v Jun 9, 2021
9204ed3
Switch to localeDateString for i18n
jaiwanth-v Jun 9, 2021
6160b11
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
jaiwanth-v Jun 9, 2021
80e5d4c
Increase eventsPerCrawl for larger chunks and rely on chunk's length …
jaiwanth-v Jun 10, 2021
a1b614f
Implement exporting from a specific start date and fix few bugs
jaiwanth-v Jun 11, 2021
ab653d9
Handle requests with no attachments
jaiwanth-v Jun 14, 2021
30c7017
Move generic functions into base class
jaiwanth-v Jun 14, 2021
bd75849
Enable option to set maximum file size
jaiwanth-v Jun 15, 2021
cff4521
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
jaiwanth-v Jun 16, 2021
9e6b8ff
Start implementation of plain text export
jaiwanth-v Jun 17, 2021
44f458d
Modify local avatar's url to not contain colons
jaiwanth-v Jun 21, 2021
45be4a6
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
jaiwanth-v Jun 22, 2021
a0e0453
Fix type lint
jaiwanth-v Jun 22, 2021
0cbcc5a
Merge branch 'export-conversations' of github.com:jaiwanth-v/matrix-r…
jaiwanth-v Jun 22, 2021
bf18920
Implement IRC bridge style reply formatting
jaiwanth-v Jun 22, 2021
c58abd9
Revert auto format
jaiwanth-v Jun 22, 2021
8a1cd77
Handle no match cases and modify textForEvent to handle redacted mess…
jaiwanth-v Jun 22, 2021
12ecaf3
i18n
jaiwanth-v Jun 22, 2021
db87550
Add text for room avatar events and skip empty text events
jaiwanth-v Jun 22, 2021
36a6931
Display redactedBecauseUserId for redacted events
jaiwanth-v Jun 22, 2021
438b9d4
Get rid of jszip and replace it with a custom library
jaiwanth-v Jun 23, 2021
b2162c3
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
jaiwanth-v Jun 23, 2021
5fff64f
Fix types
jaiwanth-v Jun 23, 2021
dd40f81
Wrap media fetch in try catch
jaiwanth-v Jun 24, 2021
4bfac11
i18n
jaiwanth-v Jun 24, 2021
112dfa2
Finish JSON export implementation
jaiwanth-v Jun 24, 2021
70cc2b2
Fix auto import
jaiwanth-v Jun 24, 2021
5447613
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
jaiwanth-v Jun 24, 2021
ccd02c4
Nicer indentation
jaiwanth-v Jun 24, 2021
91b8b2a
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
jaiwanth-v Jun 24, 2021
3718826
refactor to share downloading code across all formats
jaiwanth-v Jun 25, 2021
02f15d5
Refactor
jaiwanth-v Jun 25, 2021
abbe047
try catch for plain text
jaiwanth-v Jun 25, 2021
c885cd7
i18n
jaiwanth-v Jun 25, 2021
593f14b
Append media text to text for event
jaiwanth-v Jun 25, 2021
4af8ec4
Explicitly declare file extensions for stickers and log event fetchin…
jaiwanth-v Jun 25, 2021
566e7bc
format
jaiwanth-v Jun 25, 2021
4d6ad91
Add export option to right panel
jaiwanth-v Jun 25, 2021
c3dc51c
Create export dialog and async import export utils
jaiwanth-v Jun 26, 2021
92e34c7
Format dropdown
jaiwanth-v Jun 26, 2021
e505646
Finish dialog implementation of export settings
jaiwanth-v Jun 26, 2021
46f34ba
Add validation
jaiwanth-v Jun 26, 2021
55ffb31
Change format order
jaiwanth-v Jun 26, 2021
685441b
Remove avatarForExport string
jaiwanth-v Jun 26, 2021
398d492
Merge branch 'develop' of https://github.com/matrix-org/matrix-react-…
jaiwanth-v Jun 26, 2021
d46fe67
Handle export cancellation
jaiwanth-v Jun 27, 2021
d8f7636
Add warning modal during export
jaiwanth-v Jun 27, 2021
efd8bf3
Delint
jaiwanth-v Jun 28, 2021
64b683a
Add cancel warning and progress completion modals
jaiwanth-v Jun 28, 2021
00ee3ef
Wrap avatar fetch in try catch
jaiwanth-v Jun 28, 2021
fc81001
Hide alt text if the image isn't present (for unavailable avatars)
jaiwanth-v Jun 28, 2021
f0d0b77
Update src/TextForEvent.tsx
jaiwanth-v Jun 29, 2021
4ddbe76
Update src/components/views/dialogs/ExportDialog.tsx
jaiwanth-v Jun 29, 2021
e6cb066
Update src/utils/exportUtils/exportUtils.ts
jaiwanth-v Jun 29, 2021
efccf19
Update src/utils/exportUtils/exportUtils.ts
jaiwanth-v Jun 29, 2021
7b683a1
Update src/components/views/dialogs/ExportDialog.tsx
jaiwanth-v Jun 29, 2021
1014e9e
Update src/components/views/dialogs/ExportDialog.tsx
jaiwanth-v Jun 29, 2021
7a5aea1
Update src/components/views/dialogs/ExportDialog.tsx
jaiwanth-v Jun 29, 2021
b626a3d
Update src/components/views/dialogs/ExportDialog.tsx
jaiwanth-v Jun 29, 2021
7bbfaed
Update src/components/views/dialogs/ExportDialog.tsx
jaiwanth-v Jun 29, 2021
a92ddb3
Update src/components/views/dialogs/ExportDialog.tsx
jaiwanth-v Jun 29, 2021
e459f38
Update src/components/views/dialogs/ExportDialog.tsx
jaiwanth-v Jun 29, 2021
7a09bcb
Update src/components/views/dialogs/ExportDialog.tsx
jaiwanth-v Jun 29, 2021
60c6af5
Update src/components/views/dialogs/ExportDialog.tsx
jaiwanth-v Jun 29, 2021
b506de0
Update src/components/views/messages/MFileBody.js
jaiwanth-v Jun 29, 2021
de6bc3f
Update src/utils/exportUtils/Exporter.ts
jaiwanth-v Jun 29, 2021
025a7eb
Iterate PR
jaiwanth-v Jun 29, 2021
e404fa3
Apply suggestions
jaiwanth-v Jun 29, 2021
6cbbc0e
Replace hard coded forExport string by mxc url
jaiwanth-v Jun 29, 2021
637e3af
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
jaiwanth-v Jun 29, 2021
3fc4be0
Add return types to ABC Exporter
jaiwanth-v Jun 29, 2021
747273c
Convert input's value to string to use existing types
jaiwanth-v Jun 29, 2021
497d810
Handle mxc urls for non-encrypted rooms
jaiwanth-v Jun 29, 2021
b0be7d2
Add license and negate the conditional
jaiwanth-v Jun 29, 2021
7d5db46
Disable close icon during export
jaiwanth-v Jun 30, 2021
5516398
Merge and resolve conflicts
jaiwanth-v Jun 30, 2021
08d886e
Delint
jaiwanth-v Jun 30, 2021
6ca6646
Display progress
jaiwanth-v Jul 2, 2021
190ccb6
Merge and add export support for the modified MAudioBody
jaiwanth-v Jul 2, 2021
f2e6760
Delint
jaiwanth-v Jul 2, 2021
3dcc773
Add missing semicolon
jaiwanth-v Jul 2, 2021
87c624d
Use ref for progress updates
jaiwanth-v Jul 2, 2021
8c6f801
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
jaiwanth-v Jul 2, 2021
6a4e267
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
jaiwanth-v Jul 10, 2021
ef944a5
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
jaiwanth-v Jul 12, 2021
fe2cac5
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
jaiwanth-v Jul 19, 2021
ed93bf4
Reverse events in-place
jaiwanth-v Jul 19, 2021
f07402d
Fix types and precompute blob sizes to avoid overflows
jaiwanth-v Jul 19, 2021
6d0fd03
Delint
jaiwanth-v Jul 19, 2021
c0d2dbe
Delint once more
jaiwanth-v Jul 19, 2021
98aa1fe
Move @types/streamsaver to devDependencies
jaiwanth-v Jul 20, 2021
1ed3168
Merge upstream and resolve conflicts
jaiwanth-v Jul 21, 2021
6dd3631
Delint
jaiwanth-v Jul 21, 2021
c81bac1
Add try catch for event tile errors
jaiwanth-v Jul 23, 2021
3d4d1d3
Modify design according to the design team
jaiwanth-v Jul 25, 2021
2487fe7
Delint
jaiwanth-v Jul 25, 2021
b04bfed
Merge branch 'develop' of https://github.com/matrix-org/matrix-react-…
jaiwanth-v Jul 25, 2021
9fe64c3
Delint
jaiwanth-v Jul 25, 2021
30a64a1
Gray out and hide some options during export
jaiwanth-v Jul 26, 2021
06d84a1
Delint
jaiwanth-v Jul 26, 2021
ad1da9e
Delint2
jaiwanth-v Jul 26, 2021
a4da8f9
Update exportCSS
jaiwanth-v Jul 26, 2021
41bc2b6
Move away from streamsaver(for now)
jaiwanth-v Jul 26, 2021
b91309b
Apply suggestions from review
jaiwanth-v Jul 26, 2021
9771f4d
PascalCasing for enums
jaiwanth-v Jul 26, 2021
57590b9
Use raw-loaders to import svgs and exportJS
jaiwanth-v Jul 27, 2021
6f92276
Reduce max size to 2000 MB
jaiwanth-v Jul 27, 2021
371d102
Add jest-raw-loader
jaiwanth-v Jul 27, 2021
6f8f0e8
Change copyright year
jaiwanth-v Jul 27, 2021
04edf41
Remove unnecessary awaits
jaiwanth-v Jul 30, 2021
17e9cf4
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
jaiwanth-v Jul 30, 2021
46e2f67
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
jaiwanth-v Aug 3, 2021
4824c93
Add a test file
jaiwanth-v Aug 3, 2021
b333612
Fix comparing MB -> bytes
jaiwanth-v Aug 3, 2021
e29d9db
Fetch exportCSS during export
jaiwanth-v Aug 4, 2021
c74d6c6
Assign replacements
jaiwanth-v Aug 4, 2021
f00ab04
Delint
jaiwanth-v Aug 4, 2021
036d8a1
Merge branch 'develop' of https://github.com/matrix-org/matrix-react-…
jaiwanth-v Aug 9, 2021
45ce352
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
jaiwanth-v Aug 9, 2021
850b545
Add tests for reply regex
jaiwanth-v Aug 9, 2021
b3c03c9
Fix lint errors
jaiwanth-v Aug 9, 2021
900accd
Add test for renderToString
jaiwanth-v Aug 9, 2021
ecf0aba
Test for different types of events
jaiwanth-v Aug 10, 2021
e396dcf
Remove @types/streamsaver
jaiwanth-v Aug 10, 2021
e88edba
Merge branch 'develop' into export-conversations
jaiwanth-v Aug 12, 2021
d32f945
Merge branch 'export-conversations' of https://github.com/jaiwanth-v/…
jaiwanth-v Aug 13, 2021
edfc8af
Apply PR Suggestions
jaiwanth-v Aug 13, 2021
9cbdc4a
Use throw error instead of try-catch
jaiwanth-v Aug 13, 2021
dda24da
Add copyright headers
jaiwanth-v Aug 13, 2021
00d5a0b
Apply suggestions from code review
jaiwanth-v Aug 13, 2021
c62210b
Merge branch 'export-conversations' of https://github.com/jaiwanth-v/…
jaiwanth-v Aug 13, 2021
7207329
Apply review suggestions
jaiwanth-v Aug 13, 2021
31c9e59
Move export dialog to async-components
jaiwanth-v Aug 13, 2021
0e3ad65
Merge branch 'develop' of https://github.com/matrix-org/matrix-react-…
jaiwanth-v Aug 13, 2021
5c78acf
Remove forExport prop for MemberAvatar
jaiwanth-v Aug 13, 2021
3efa699
Delint
jaiwanth-v Aug 13, 2021
5dbc103
Modify font-regex and declare json type
jaiwanth-v Aug 14, 2021
33bc26f
Change summary tiles order
jaiwanth-v Aug 17, 2021
4dae737
i18n
jaiwanth-v Aug 17, 2021
7bad0b9
Fix links, header and export text
jaiwanth-v Aug 18, 2021
fea9f4a
Use staticMarkup instead of string
jaiwanth-v Aug 18, 2021
98b0642
Split html into multiple files to improve scroll performance
jaiwanth-v Aug 20, 2021
6a26154
Merge branch 'develop' of https://github.com/matrix-org/matrix-react-…
jaiwanth-v Aug 20, 2021
b49c8eb
Increase max_width for exported html
jaiwanth-v Aug 20, 2021
94e4fb7
Merge branch 'develop' into export-conversations
jaiwanth-v Sep 22, 2021
d1e3d35
Change export bundle filename format, light theme for all exports and…
jaiwanth-v Sep 22, 2021
f35dae8
i18n
jaiwanth-v Sep 22, 2021
208b914
Merge branch 'develop' into export-conversations
jaiwanth-v Sep 29, 2021
6ccb7e9
Space after brand
jaiwanth-v Sep 29, 2021
d264f5f
Change js-sdk import style
jaiwanth-v Sep 29, 2021
e026725
Initialize css string
jaiwanth-v Sep 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/utils/exportUtils/Exporter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import Room from 'matrix-js-sdk/src/models/room';
jaiwanth-v marked this conversation as resolved.
Show resolved Hide resolved

export abstract class Exporter {
constructor(protected res: MatrixEvent[], protected room: Room) {}
abstract export(): Promise<void>
jaiwanth-v marked this conversation as resolved.
Show resolved Hide resolved
}
10 changes: 3 additions & 7 deletions src/utils/exportUtils/HtmlExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { textForEvent } from "../../TextForEvent";
import { Room } from 'matrix-js-sdk/src/models/room';
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { getUserNameColorClass } from "../FormattingUtils";

import { Exporter } from "./Exporter";

const css = `
body {
Expand Down Expand Up @@ -273,16 +273,12 @@ div.mx_selected {
}
`;


export default class HTMLExporter {
export default class HTMLExporter extends Exporter {
protected zip: JSZip;
protected res: MatrixEvent[];
protected room: Room;
protected avatars: Map<string, boolean>;

constructor(res: MatrixEvent[], room: Room) {
this.res = res;
this.room = room;
super(res, room);
this.zip = new JSZip();
this.avatars = new Map<string, boolean>();
}
Expand Down