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.
19 lines
483 B
JavaScript
19 lines
483 B
JavaScript
3 years ago
|
"use strict";
|
||
|
|
||
|
const matchValue = require("match-value");
|
||
|
|
||
|
const addCommonFields = require("../event-add-common-fields");
|
||
|
|
||
|
module.exports = function mapHistoryVisibilityEvent(event, _context) {
|
||
|
return addCommonFields(event, {
|
||
|
type: "historyVisibilityChanged",
|
||
|
sender: event.sender,
|
||
|
visibility: matchValue(event.content.history_visibility, {
|
||
|
world_readable: "public",
|
||
|
shared: "membersOnly",
|
||
|
invited: "membersSinceInvited",
|
||
|
joined: "membersSinceJoined"
|
||
|
})
|
||
|
});
|
||
|
};
|