"use strict";

const addCommonFields = require("../event-add-common-fields");
const mapMaybeRedacted = require("../map-maybe-redacted");

module.exports = function mapRoomAvatarEvent(event, _context) {
	// TODO: This event can optionally include image metadata and a thumbnail, like an m.image message!
	return addCommonFields(event, {
		type: "roomAvatarChanged",
		sender: event.sender,
		... mapMaybeRedacted(event, () => ({
			url: event.content.url
		}))
	});
};
