From c77d5e3c93b96a40017d45f6ba414f402e46aae7 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Thu, 27 May 2021 00:19:31 +0200 Subject: [PATCH] Fix: boucle infinie de messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit en cas d'appel de ChatUtility.onRemoveMessages par un joueur, on entre en boucle infinie de messages envoyés sur les sockets --- module/chat-utility.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/module/chat-utility.js b/module/chat-utility.js index 59269d81..1a51e194 100644 --- a/module/chat-utility.js +++ b/module/chat-utility.js @@ -23,19 +23,19 @@ export class ChatUtility { game.messages.get(data.messageId)?.delete(); } } - else { - game.socket.emit("system.foundryvtt-reve-de-dragon", { msg: "msg_delete_chat_message", data: data }); - } } + static removeMessages(data) { + game.socket.emit("system.foundryvtt-reve-de-dragon", { msg: "msg_delete_chat_message", data: data }); + } /* -------------------------------------------- */ static removeChatMessageContaining(part) { - ChatUtility.onRemoveMessages({ part: part }); + ChatUtility.removeMessages({ part: part }); } static removeChatMessageId(messageId) { - ChatUtility.onRemoveMessages({ messageId: messageId }); + ChatUtility.removeMessages({ messageId: messageId }); } /* -------------------------------------------- */