Make it possible to move decrypted mails
* src/Makefile.am: Add folder-events.cpp * src/eventsinks.h (install_FolderEvents_sink), (detach_FolderEvents_sink): New. * src/folder-events.cpp: New event handler. * src/mail.cpp (s_folder_events_map): New map to track registered handlers. (Mail::isAboutToBeMoved, Mail::setIsAboutToBeMoved): New. (Mail::installFolderEventHandler_o): New. (Mail::closeAllMails_o): detach folder handler. * src/mail.h: Update accordingly. * src/mailitem-events.cpp (Write): Pass if mail is about to be moved. * src/oomhelp.h (IID_FolderEvents): New.
While the application has the item copy events the folder
has a before item move event. To catch this we register an
event handler for each folder in which a mail was decrypted.
If a crypto mail is then about to be moved we close it with
discard changes to discard the plaintext, then we pass
the write event to allow the move.
Works flawlessly in the first tests.
- GnuPG-Bug-Id: T3418