do not display messages not for us

This commit is contained in:
zznty
2022-07-28 20:01:56 +07:00
parent f7ec604161
commit 6ceb81f126

View File

@@ -77,8 +77,9 @@ public class ChatController : WebApiController, IChatController
throw HttpException.BadRequest("Invalid channel and targetId combination"); throw HttpException.BadRequest("Invalid channel and targetId combination");
} }
if (Statics.Torch.CurrentSession?.Managers.GetManager<IChatManagerServer>() is { } manager) if (Statics.Torch.CurrentSession?.Managers.GetManager<IChatManagerServer>() is { } manager &&
manager.DisplayMessageOnSelf(request.Author, request.Message); request.Channel is ChatChannel.Global or ChatChannel.GlobalScripted)
manager.DisplayMessageOnSelf(msg.CustomAuthorName, msg.Text);
} }
[Route(HttpVerbs.Post, $"{RootPath}/command")] [Route(HttpVerbs.Post, $"{RootPath}/command")]