aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Sadie Powell2024-07-19 01:34:52 +0100
committerGravatar Sadie Powell2024-07-19 01:34:52 +0100
commitd2fcfeac8bca1b43fa6a34f11c466f6cafeafa2f (patch)
tree6b7fab6a89344ddc54006f95d375c789385f9d07
parentWhen recloaking a user don't unset their old host first. (diff)
Avoid sending blank messages to users.
-rw-r--r--src/users.cpp5
1 files changed, 1 insertions, 4 deletions
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<ConnectClass>& 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();