On sobota 3. února 2018 16:43:58 CET, Erik Quaeghebeur wrote:
From my investigation of the code, it seems as if the first
step would be to merge the current ComposeWidget::createReply
and ComposeWidget::createForward methods: they share quite a bit
of code and ComposeWidget::createForward does not allow
including a body.
Hi Erik, I think that this is more complex. MIME, a standard which defines
how e-mail boddies look like, is quite complex. In short, an e-mail might
be an arbitrarily nested tree-like structure. Trojita can reasonably easily
parse all of that, and also render and display that in the regular message
viewer. When it comes to editting or creating new e-mails, then it's a
different thing.
Right now, the composer only supports creating messages with a single
plaintext "main" part, and possibly some attachments. If there are no
attachments, then the resulting message is a pretty simple text/plain
thing, nothing to see there. When at least one attachment is present, then
the entire message gets trnasformed into a multipart/mixed with a flat list
of other parts. The first child of that multipart/mixed is the "main"
text/plain once again, and the rest are the "attachments". This probably
matches what the user expects to see, and what the UI allows the user to
create.
However, this would have to change, somehow, if we start allowing edits of
arbitrary e-mail messages. Take a look at the MIME torture test by MArk
Crispin [1], for example. How should the composer look like after opening
something like *that*?
There are also other features or misfeatures and, er, "customs" when it
comes to e-mails. Check the past discussions that me and Pali had when it
came to the format=flowed feature of Trojita, and the expectation that
users might want to paste patches for LKML-style development workflow.
We could probably define some thresholds, such as only allowing edits of
"supported" MIME tree shapes. That's doable, but it's some work, and that
work should -- IMHO -- start with describing how the whole thing should
behave. It will be something that's very useful for Trojita users, though
-- that's for sure.
Cheers,
Jan
[1]
http://gd.tuwien.ac.at/infosys/mail/imap/mime-examples/torture-test.mbox
--
Trojitá, a fast Qt IMAP e-mail client -- http://trojita.flaska.net/