Add the includeRequestor option and deprecate includeGM in the notify socket

This commit is contained in:
Oliver 2026-01-09 01:44:32 -07:00
parent 587a54c5bd
commit f289c94c0a
2 changed files with 19 additions and 4 deletions

View file

@ -229,17 +229,26 @@ async function maybeResolve(requestID) {
};
};
export async function notify(requestID, userID, content, { includeGM = false } = {}) {
export async function notify(requestID, userID, content, { includeGM = false, includeRequestor } = {}) {
// Prevent sending notifications for not-your queries
if (!queries.has(requestID)) { return };
// TODO: remove this code with #19
if (includeGM) {
foundry.utils.logCompatibilityWarning(
`The "includeGM" option has been deprecated in favour of "includeRequestor"`,
{ since: `v2.4.0`, until: `v3.0.0` },
);
};
game.socket.emit(`system.taf`, {
event: `query.notify`,
payload: {
id: requestID,
userID,
content,
includeGM,
includeGM, // TODO: remove this code with #19
includeRequestor,
},
});
};