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.

15 lines
452 B
JavaScript

"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
});
};