From d2fcfeac8bca1b43fa6a34f11c466f6cafeafa2f Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 19 Jul 2024 01:34:52 +0100 Subject: Avoid sending blank messages to users. --- src/users.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index e70832f80..4d63dc86e 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -707,14 +707,11 @@ void LocalUser::ChangeConnectClass(const std::shared_ptr& klass, b void LocalUser::Write(const ClientProtocol::SerializedMessage& text) { - if (!eh.HasFd()) + if (!eh.HasFd() || text.empty()) return; if (ServerInstance->Config->RawLog) { - if (text.empty()) - return; - std::string::size_type nlpos = text.find_first_of("\r\n", 0, 2); if (nlpos == std::string::npos) nlpos = text.length(); -- cgit v1.3.1-10-gc9f91