From 26919f41d2e2089ca0a4f402cd948d067d030704 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 29 Feb 2024 12:31:19 +0000 Subject: [PATCH] If a PRIVMSG or NOTICE is empty then send a single space instead. Currently a bunch of code does source.Reply(" ") to ensure that an empty line gets rendered but this is a much better way to handle this problem. The code that does this already will be updated in a future commit to avoid breaking translations in progress. --- src/protocol.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/protocol.cpp b/src/protocol.cpp index 007627114..9c614efbf 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -119,12 +119,12 @@ void IRCDProto::SendKick(const MessageSource &source, const Channel *c, User *u, void IRCDProto::SendNoticeInternal(const MessageSource &source, const Anope::string &dest, const Anope::string &msg, const Anope::map &tags) { - Uplink::Send(tags, source, "NOTICE", dest, msg); + Uplink::Send(tags, source, "NOTICE", dest, msg.empty() ? " " : msg); } void IRCDProto::SendPrivmsgInternal(const MessageSource &source, const Anope::string &dest, const Anope::string &msg, const Anope::map &tags) { - Uplink::Send(tags, source, "PRIVMSG", dest, msg); + Uplink::Send(tags, source, "PRIVMSG", dest, msg.empty() ? " " : msg); } void IRCDProto::SendQuit(User *u, const Anope::string &buf)