spec/integ/megolm-integ.spec.js
function encryptGroupSessionKey(opts) {
    return encryptOlmEvent({
        senderKey: opts.senderKey,
        recipient: opts.recipient,
        p2pSession: opts.p2pSession,
        plaincontent: {
            algorithm: 'm.megolm.v1.aes-sha2',
            room_id: opts.room_id,
            session_id: opts.groupSession.session_id(),
            session_key: opts.groupSession.session_key(),
        },
        plaintype: 'm.room_key',
    });
}
function encryptGroupSessionKey(opts) {
    return encryptOlmEvent({
        senderKey: opts.senderKey,
        recipient: opts.recipient,
        p2pSession: opts.p2pSession,
        plaincontent: {
            algorithm: 'm.megolm.v1.aes-sha2',
            room_id: opts.room_id,
            session_id: opts.groupSession.session_id(),
            session_key: opts.groupSession.session_key(),
        },
        plaintype: 'm.room_key',
    });
}
function encryptGroupSessionKey ( opts ) { return encryptOlmEvent ( { senderKey : opts . senderKey , recipient : opts . recipient , p2pSession : opts . p2pSession , plaincontent : { algorithm : 'm.megolm.v1.aes-sha2' , room_id : opts . room_id , session_id : opts . groupSession . session_id ( ) , session_key : opts . groupSession . session_key ( ) , } , plaintype : 'm.room_key' , } ) ; }
build an encrypted room_key event to share a group session

@param {object} opts
@param {string} opts.senderKey
@param {TestClient} opts.recipient
@param {Olm.Session} opts.p2pSession
@param {Olm.OutboundGroupSession} opts.groupSession
@param {string=} opts.room_id

@return {object} event
build an encrypted room_key event to share a group session