From 44f406caf0c0ce582be31d0f1fb436f3f31d0d3c Mon Sep 17 00:00:00 2001 From: Meisam <39205857+MFTabriz@users.noreply.github.com> Date: Tue, 27 Jul 2021 19:42:05 +0200 Subject: [PATCH] reject user messages when offline (#1269) --- core/chat/events.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/chat/events.go b/core/chat/events.go index 9277c556d..c8298e7e9 100644 --- a/core/chat/events.go +++ b/core/chat/events.go @@ -80,6 +80,11 @@ func (s *ChatServer) userMessageSent(eventData chatClientEvent) { return } + // Ignore if the stream in offline + if !getStatus().Online { + return + } + event.User = user.GetUserByToken(eventData.client.accessToken) // Guard against nil users