package foundation.e.mail.message;


import java.util.List;

import foundation.e.mail.crypto.MessageCryptoStructureDetector;
import foundation.e.mail.mail.Message;
import foundation.e.mail.mail.Part;


public class ComposePgpEnableByDefaultDecider {
    public boolean shouldEncryptByDefault(Message localMessage) {
        return messageIsEncrypted(localMessage);
    }

    private boolean messageIsEncrypted(Message localMessage) {
        List<Part> encryptedParts = MessageCryptoStructureDetector.findMultipartEncryptedParts(localMessage);
        return !encryptedParts.isEmpty();
    }
}
