Add ConversionError field to Composer.Part to track multipart conversion
errors.
Check for conversion errors in :send, block sending if the errors are
found.
Signed-off-by: Vitaly Ovchinnikov <v@ovch.ru>
---
The patch helps with the configurations like this:
binds.conf:
[compose::review]
y = :multipart text/html<Enter>:send<Enter>
aerc.conf:
[multipart-converters]
text/html = /path/to/some/script.sh
/path/to/some/script.sh:
#!/bin/sh
exit 10 # falls for some reason
Without the patch, when you press `y` aerc runs `:multipart` command and
although it gets an error from the converter script, the error is
ignored and then the `:send` command actually sends a broken message.
The patch stores conversion errors for the message parts and checks for
them in `:send`. If the error is found, the sending is blocked and the
user gets an error message.
There is no way to skip this like missing attachment or empty subject.
This is done intentionally, as this is a problem of different level to
me. The user needs to update or delete the problem part before actually
sending a message.
Unfortunately, this patch breaks my workflow: I used to :accept calendar invitations and, in the review screen, I used to get an error in red saying "text/calendar error: no command defined for mime/type", but still I was able to send the message (and thus accept the invitation).
After this patch, I can't :accept invitations anymore. :(