async function checkExpiration(message, emails = []) {
        const sendPrefs = await sendPreferences.get(emails, message);

        // Filter the emails with the preferences which include this type
        const filterTypes = (types = [], shouldEncrypt = false) =>
            emails.filter((email) => {
                const { scheme, encrypt } = sendPrefs[email];
                return shouldEncrypt === encrypt && types.includes(scheme);
            });

        // Contacts for which to send with password.
        const clear = filterTypes(EXTERNAL_SCHEMES, false);
        // Contacts which include encrypted PGP sending.
        const pgp = filterTypes(EXTERNAL_SCHEMES, true);

        if (message.ExpirationTime && (pgp.length || clear.length)) {
            return confirmExpiration({ pgp, clear });
        }
    }
/**
     * Check if the message has the requirement if ExpirationTime is defined
     * @param  {Object} message
     * @param {Array} emails list of email address (string)
     * @return {Promise}
     */
Check if the message has the requirement if ExpirationTime is defined
@param  {Object} message
@param {Array} emails list of email address (string)
@return {Promise}
Check if the message has the requirement if ExpirationTime is defined @param { Object } message @param { Array } emails list of email address ( string ) @return { Promise }
async function checkExpiration(message, emails = []) {
        const sendPrefs = await sendPreferences.get(emails, message);
        const filterTypes = (types = [], shouldEncrypt = false) =>
            emails.filter((email) => {
                const { scheme, encrypt } = sendPrefs[email];
                return shouldEncrypt === encrypt && types.includes(scheme);
            });
        const clear = filterTypes(EXTERNAL_SCHEMES, false);
        const pgp = filterTypes(EXTERNAL_SCHEMES, true);
        if (message.ExpirationTime && (pgp.length || clear.length)) {
            return confirmExpiration({ pgp, clear });
        }
    }
async function checkExpiration ( message , emails = [ ] ) { const sendPrefs = await sendPreferences . get ( emails , message ) ; const filterTypes = ( types = [ ] , shouldEncrypt = false ) => emails . filter ( ( email ) => { const { scheme , encrypt } = sendPrefs [ email ] ; return shouldEncrypt === encrypt && types . includes ( scheme ) ; } ) ; const clear = filterTypes ( EXTERNAL_SCHEMES , false ) ; const pgp = filterTypes ( EXTERNAL_SCHEMES , true ) ; if ( message . ExpirationTime && ( pgp . length || clear . length ) ) { return confirmExpiration ( { pgp , clear } ) ; } }
Check if the message has the requirement if ExpirationTime is defined
 @param  {Object} message
 @param {Array} emails list of email address (string)
 @return {Promise}
Check if the message has the requirement if ExpirationTime is defined @param { Object } message @param { Array } emails list of email address ( string ) @return { Promise }
// Filter the emails with the preferences which include this type // Contacts for which to send with password. // Contacts which include encrypted PGP sending.