src/crypto/index.js
// returns a promise which resolves to the response
returns a promise which resolves to the response
returns a promise which resolves to the response
function _uploadDeviceKeys(crypto) {
    const userId = crypto._userId;
    const deviceId = crypto._deviceId;
    const deviceKeys = {
        algorithms: crypto._supportedAlgorithms,
        device_id: deviceId,
        keys: crypto._deviceKeys,
        user_id: userId,
    };
    crypto._signObject(deviceKeys);
    return crypto._baseApis.uploadKeysRequest({
        device_keys: deviceKeys,
    }, {
        device_id: deviceId,
    });
}
function _uploadDeviceKeys ( crypto ) { const userId = crypto . _userId ; const deviceId = crypto . _deviceId ; const deviceKeys = { algorithms : crypto . _supportedAlgorithms , device_id : deviceId , keys : crypto . _deviceKeys , user_id : userId , } ; crypto . _signObject ( deviceKeys ) ; return crypto . _baseApis . uploadKeysRequest ( { device_keys : deviceKeys , } , { device_id : deviceId , } ) ; }
returns a promise which resolves to the response
returns a promise which resolves to the response
// for now, we set the device id explicitly, as we may not be using the // same one as used in login.