From 6ceb81f126c3ee7b5f9f886dd397467a8ea5182c Mon Sep 17 00:00:00 2001 From: zznty <94796179+zznty@users.noreply.github.com> Date: Thu, 28 Jul 2022 20:01:56 +0700 Subject: [PATCH] do not display messages not for us --- TorchRemote.Plugin/Controllers/ChatController.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/TorchRemote.Plugin/Controllers/ChatController.cs b/TorchRemote.Plugin/Controllers/ChatController.cs index 9155b27..5b05c37 100644 --- a/TorchRemote.Plugin/Controllers/ChatController.cs +++ b/TorchRemote.Plugin/Controllers/ChatController.cs @@ -77,8 +77,9 @@ public class ChatController : WebApiController, IChatController throw HttpException.BadRequest("Invalid channel and targetId combination"); } - if (Statics.Torch.CurrentSession?.Managers.GetManager() is { } manager) - manager.DisplayMessageOnSelf(request.Author, request.Message); + if (Statics.Torch.CurrentSession?.Managers.GetManager() is { } manager && + request.Channel is ChatChannel.Global or ChatChannel.GlobalScripted) + manager.DisplayMessageOnSelf(msg.CustomAuthorName, msg.Text); } [Route(HttpVerbs.Post, $"{RootPath}/command")]