Export Chat to zip

This is a note about the progress on the current plan of implementing Exporting Chats to an universal format for use for archival or as proof of something.
This is just meant as a todo-list/issue and not as an open feature discussion, if you want to propose an better idea please do so in a new or existing Feature Proposal topic.
You may post small improvement ideas here as long as they don’t blow up the scope like “re-importing the exported chat”.

The current idea is just to have something little more than the barebone text, irc-like thing that whatsapp has, so more in the direction of telegrams html exporter.

Current PR

🚧Export Chat 2 by Simon-Laux · Pull Request #1601 · chatmail/core · GitHub
Left todo:

  • error handling (get rid of most unwrap)
  • ffi interface
  • json scheme that describes chat.json
  • test if files are there in archive (python?)

TODO

  • Export Locations
    • KML
    • GeoJSON
  • HTML Viewer
  • More Advanced Testing
    • Check validity and document json files with json schema
  • Report a progress like backup export (mainly write to zip step)

Ideas

  • api to only export a specific range (start date, end date)
  • option to delete exported messages
3 Likes

Would like to export directly to html too (first approach of PR).

I tested that approach (output format) locally and it looks nice and very handy. IMHO ideal for end user?

IMHO ideal for end user?

yes, even though with json we have a format third parties could use to provide users with even more possibilities. (such as maybe importing messages from deltachat into other messengers)

The main reason I decided to go for json first is that I can easily test it (adding ci tests for it) and I did feel like I was stuck in constructing the html manually, so I came to the conclusion that it’s probably easier to construct json and then have the html be a generic viewer app (in javascript) that consumes the json and is just shipped along side it in the output zip file.

I’m currently rather busy so I can’t do much on it right now.
If you do have time for it feel free to code an html export, I can then help you making it ready to be merged into the core if you need my help (doing ffi for it and maybe other things like api design).
But considering all cases and make it look exactly like desktop could be a tricky thing also I don’t know how tests for it would look like.

@Simon
Don’t worry. You did the most work for html export and your work looks great!
IMHO anyway I would not have the expectation to let it look exactly as desktop version.
More I think it should be as simple as possible but should contain all informations in a transparent way for user.
If html structure is simple then anyway it’s no problem to use it for a future import again.

Based on your work and your css I did an example html file and was impressed how good you meet the desktop look and feel :+1:

Within next week hopefully I will get the time to start including the export into my fork :slight_smile:

But for extending ffi definitely I need some assistance how to do that.

My plan is

  1. get it run by core
  2. define and include an ffi interface
  3. add a ui control(s)

would it be an mbox export? that would be true standard.

I think it would probably be best to outsource such an export function to a webxdc app. This way, the user interface wouldn’t need to be changed. Users could create a backup, open it in the app, and then select individual chats to export.

1 Like

Is there any progress someone can point me to on this enhancement?

I do strongly believe an export format that is easily viewable as a frozen copy of DeltaChat is ideal. Navigating an sqlite db is unacceptable for most people. There is talk in the PR about creating an HTML version, but exporting my chats today on Desktop didn’t provide this option.

If not from DeltaChat, is there a viewer for exports that can be shared/promoted to DeltaChat users?

You can use an ordinary e-mail client in thread view to read old chats, but you have to download the messages from the IMAP server within, usually, 30 days of receipt. You can then easily store them in MBox or Maildir format.

Details on how to get a standard-format copy of your chats.

Could there be a less complicated way then the process you’re proposing? A way to read delta-chat backups in a user-friendly way which does not require the delta-chat client is ideal. A file backup format that is readable using common software is ideal for those wishing to use delta chat for all comms going forward. Backups are currently only readable from (1) the delta-chat app (2) or using any email client as long as you follow your instructions, which are not acceptable for most people.

3 Likes

a third party script might be worth developing if the code required for this kind of export goes beyond the scope of delta chat core app

1 Like

Related posts:

The latter is good news, it looks like being able to copy-paste chunks of a chat (not just individual messages) is currently rolling out.

1 Like

See example JSON output from Instagram chat exports here: App/feature request: export an entire chat's transcript - #2 by maphouse

Note that a major flaw with instagram’s export is that emoji reacts done by other senders are contained in the JSON but not the sender whose account is doing the export (i.e. you, as exporter, see “reacts” and “so-and-so like your message” in your chat export but the reacts that you did to others are not listed).

I just tested this signal chat export python package and it works really well: GitHub - carderne/signal-export: Export your Signal chats to markdown files with attachments

It exports JSON as well as a styled html page with headers to navigate the chat history

This makes sense but a standard maildir or mbox would make more sense imo

1 Like

I think DC doesn’t actually save all the e-mail header info, but missing or placeholder data would be fine.