Home GnuPG
Diffusion GpgOL e1420cc2a8f0

Fix explorer display after mail was closed
e1420cc2a8f0Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Fix explorer display after mail was closed

* src/mailitem-events.cpp (request_decrypt): New. Request a decypt.
(EVENT_SINK_INVOKE(MailItemEvents)): Handle decrypt_after_write.
Don't always unload in unload.
* src/windowmessages.cpp: Handle REQUEST_DECRYPT.
* src/windowmessages.h: Add REQUEST_DECRYPT.

To prevent the question of wether or not to save the changes
(Which would save the decrypted data without an event to
prevent it) we save proactively. This happens by set_needs_save
and calling save. Which will revert a mail because we never want
to save unreverted mails.

But as a side effect the mail, if opened in the explorer still will
be reverted, too. So shown as empty. This is bad. To prevent that
we request a decrypt in the AfterWrite event.

Evil Hack: Outlook sends an Unload event after the message is closed
This is not true our Internal Object is kept alive if it is opened
in the explorer. So we ignore the unload event and then check in
the window message handler that checks for decrypt again if the
mail is currently open in the active explorer. If not we delete our
Mail object so that the message is released.

Details

Provenance
aheineckeAuthored on Oct 20 2016, 11:53 AM
Parents
rO71b06f0662a2: Revert all active mails on quit
Branches
Unknown
Tags
Unknown