mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-02 02:53:01 +08:00
15 lines
484 B
CoffeeScript
Executable file
15 lines
484 B
CoffeeScript
Executable file
{MessageViewExtension, Actions} = require 'nylas-exports'
|
|
PGPKeyStore = require './pgp-key-store'
|
|
|
|
class DecryptPGPExtension extends MessageViewExtension
|
|
@formatMessageBody: ({message}) =>
|
|
if not PGPKeyStore.hasEncryptedComponent(message)
|
|
return message
|
|
if PGPKeyStore.isDecrypted(message)
|
|
message.body = PGPKeyStore.getDecrypted(message)
|
|
else
|
|
# trigger a decryption
|
|
PGPKeyStore.decrypt(message)
|
|
message
|
|
|
|
module.exports = DecryptPGPExtension
|