src/client.js
function keysFromRecoverySession(sessions, decryptionKey, roomId) {
    const keys = [];
    for (const [sessionId, sessionData] of Object.entries(sessions)) {
        try {
            const decrypted = keyFromRecoverySession(sessionData, decryptionKey);
            decrypted.session_id = sessionId;
            decrypted.room_id = roomId;
            keys.push(decrypted);
        } catch (e) {
            console.log("Failed to decrypt session from backup");
        }
    }
    return keys;
}
function keysFromRecoverySession(sessions, decryptionKey, roomId) {
    const keys = [];
    for (const [sessionId, sessionData] of Object.entries(sessions)) {
        try {
            const decrypted = keyFromRecoverySession(sessionData, decryptionKey);
            decrypted.session_id = sessionId;
            decrypted.room_id = roomId;
            keys.push(decrypted);
        } catch (e) {
            console.log("Failed to decrypt session from backup");
        }
    }
    return keys;
}
function keysFromRecoverySession ( sessions , decryptionKey , roomId ) { const keys = [ ] ; for ( const [ sessionId , sessionData ] of Object . entries ( sessions ) ) { try { const decrypted = keyFromRecoverySession ( sessionData , decryptionKey ) ; decrypted . session_id = sessionId ; decrypted . room_id = roomId ; keys . push ( decrypted ) ; } catch ( e ) { console . log ( "Failed to decrypt session from backup" ) ; } } return keys ; }
6 hours - an arbitrary value
6 hours - an arbitrary value