From cfb29cfd831b8c44112dd15c821ce235e78beb2e Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Mon, 7 Apr 2025 16:42:48 +0800 Subject: internal(session::writeChat): also be bool, returns write()'s bool --- src/session.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/session.cpp') diff --git a/src/session.cpp b/src/session.cpp index 50f55bb..c71432d 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -249,13 +249,14 @@ bool CSession::write(const std::string &msg) { return write("{}", msg); } -void CSession::writeChat(const CChatManager::SMessage &msg) { +bool CSession::writeChat(const CChatManager::SMessage &msg) { if (m_name != msg.username) { if (msg.admin && !m_isAdmin) - return; + return false; - write(g_pChatManager->fmtBroadcastMessage(msg)); + return write(g_pChatManager->fmtBroadcastMessage(msg)); } + return false; } const std::string &CSession::getName() const { -- cgit v1.2.3