"use strict";

const required = require("@validatem/required");

const isEvent = require("../is-event");
const isMatrixID = require("../is-matrix-id");

// NOTE: Unspecced, see https://github.com/matrix-org/matrix-doc/issues/2680 - this would normally just be `isEvent` as per the spec
module.exports = function isPresenceEvent(strict = false, extraFields = {}) {
	return isEvent(strict, {
		sender: [ required, isMatrixID ],
		... extraFields
	});
};
