Home GnuPG
Diffusion GpgOL 87e96e7ee79e

Make it possible to move decrypted mails

Description

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.

Finally!
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.

Details

Provenance
aheineckeAuthored on Jun 26 2018, 4:18 PM
Parents
rOb800b5ca1ef6: Enable auto-key-retrieve if autoresolve is set
Branches
Unknown
Tags
Unknown
Tasks
T3418: Problems plugin Outlook 2010