You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
561 B
JavaScript
17 lines
561 B
JavaScript
"use strict";
|
|
|
|
const addCommonFields = require("../event-add-common-fields");
|
|
const normalizeEncryptionAlgorithmName = require("../normalize-encryption-algorithm-name");
|
|
|
|
module.exports = function mapEncryptionEvent(event, _context) {
|
|
return addCommonFields(event, {
|
|
type: "encryptionEnabled",
|
|
sender: event.sender,
|
|
algorithm: normalizeEncryptionAlgorithmName(event.content.algorithm),
|
|
encryptionConfiguration: {
|
|
rotateSessionAfterTime: event.content.rotation_period_ms,
|
|
rotateSessionAfterMessages: event.content.rotation_period_msgs
|
|
}
|
|
});
|
|
};
|