Creating messages

About

E-mail clients have to create messages that will be sent. TMut has a very small message-create window called TMutMsgCreator. It can deal with attachments, forwards and it can build your plain text E-mail's body. It can't (yet) deal with HTML E-mails. Maybe something for the future?

Design

TMutMsgCreator is a very straightforward GtkVBox based GtkWidget that puts a few other widgets on your screen, like a few text boxes for data entry. The only method that does something special is the on_send_button_clicked one.

One special thingy in on_send_button_clicked: that thread thing

It starts a thread for the following reason: in the future it might be possible that tny_mime_part_add_part takes some time downloading parts that have not yet been cached. Especially parts when forwarding an existing message that we have not yet fully downloaded. If you forward a message that has yet uncached parts, then we need to fetch these parts first of course.

However, the cute part is that Lemonade capable IMAP servers will soon have Forward-Without-Download, making downloading the parts unnecessary. Yet only the IMAP servers that are capable of doing this can do it, of course. Therefore we'll have to come up with an API that is convenient for both situations. Preferably a single API as the application developer will most likely not really want to care how Tinymail solves this for him.

I can only advise you to keep an eye on what the most ideal way of doing this will be in the future. This API might change as I, being Tinymail's maintainer, personally dislike it when the application developer has to manage his own threading. My humble opinion is that Tinymail should take care of asynchronous operating for the application developer.

Implementation