"use strict";

const matchValue = require("match-value");

const addCommonFields = require("../event-add-common-fields");

module.exports = function mapGuestAccessEvent(event, _context) {
	return addCommonFields(event, {
		type: "guestAccessChanged",
		sender: event.sender,
		guestsCanJoin: matchValue(event.content.guest_access, {
			can_join: true,
			forbidden: false
		})
	});
};
