From 19ecec7483a895352377dc8a34e41aed57f9d74f Mon Sep 17 00:00:00 2001 From: est31 Date: Sat, 31 Oct 2015 06:49:34 +0100 Subject: [PATCH] Remove unneeded check --- src/server.cpp | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/server.cpp b/src/server.cpp index 9031da0db986..d52020659293 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -2798,26 +2798,23 @@ std::wstring Server::handleChat(const std::string &name, const std::wstring &wna line += wmessage; } - - if (line != L"") { + /* + Tell calling method to send the message to sender + */ + if (!broadcast_line) { + return line; + } else { /* - Tell calling method to send the message to sender + Send the message to others */ - if (!broadcast_line) { - return line; - } else { - /* - Send the message to others - */ - actionstream << "CHAT: " << wide_to_narrow(line) << std::endl; + actionstream << "CHAT: " << wide_to_narrow(line) << std::endl; - std::vector clients = m_clients.getClientIDs(); + std::vector clients = m_clients.getClientIDs(); - for (u16 i = 0; i < clients.size(); i++) { - u16 cid = clients[i]; - if (cid != peer_id_to_avoid_sending) - SendChatMessage(cid, line); - } + for (u16 i = 0; i < clients.size(); i++) { + u16 cid = clients[i]; + if (cid != peer_id_to_avoid_sending) + SendChatMessage(cid, line); } } return L"";