Add the includeRequestor option and deprecate includeGM in the notify socket
This commit is contained in:
parent
587a54c5bd
commit
f289c94c0a
2 changed files with 19 additions and 4 deletions
|
|
@ -1,8 +1,8 @@
|
|||
import { localizer } from "../../utils/localizer.mjs";
|
||||
import { respondedToQueries } from "../../utils/QueryManager.mjs";
|
||||
|
||||
export function queryNotify(payload) {
|
||||
const { id, userID, content, includeGM } = payload;
|
||||
export function queryNotify(payload, sender) {
|
||||
const { id, userID, content, includeGM, includeRequestor } = payload;
|
||||
|
||||
if (userID !== game.user.id) { return };
|
||||
|
||||
|
|
@ -10,10 +10,16 @@ export function queryNotify(payload) {
|
|||
if (!respondedToQueries.has(id)) { return };
|
||||
|
||||
let whisper = [game.user.id];
|
||||
|
||||
// TODO: remove this code with #19
|
||||
if (includeGM) {
|
||||
whisper = game.users.filter(u => u.isGM).map(u => u.id);
|
||||
};
|
||||
|
||||
if (includeRequestor) {
|
||||
whisper = [sender.id];
|
||||
};
|
||||
|
||||
ChatMessage.implementation.create({
|
||||
flavor: localizer(`taf.misc.data-query-notif-header`),
|
||||
content,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue