Remove the need to revert mails
* src/application-events.cpp (EVENT_SINK_INVOKE): Remove comment. * src/gpgoladdin.cpp (GpgolAddin::OnDisconnection): Close instead revert. (GpgolAddin::OnStartupComplete): Create Window message hook. * src/mail.cpp (Mail::close_all_mails): New. * src/mail.h: Update accordingly. * src/mailitem-events.cpp (request_close): New. src/mailitem-events.cpp (EVENT_SINK_INVOKE): Update event handling to new logic. See comments. * src/windowmessages.cpp (gpgol_hook): New. (create_message_hook): New. Registers gpgol_hook. src/windowmessages.h: Update accordingly.
This is basically the yewel of the nomapi branch. Without
persistent changes in MAPI we can just close the Mails with
discard changes set to true to "revert" our mails. This
removes the need for a revert and Outlook won't create new
mails containing our reverted mails.
There should be no more need for revert at all. It's left
in as an additional fallback in case something fails.