From d0a995d6da742872a159167415abed2b5b5b20ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjist=C3=B3f?= Date: Sun, 4 Dec 2016 13:59:17 +0100 Subject: [PATCH] fixed bugs (random tabs appering) regarding message content handling --- chat_networking.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/chat_networking.hpp b/chat_networking.hpp index bdc2ca0..3499b41 100644 --- a/chat_networking.hpp +++ b/chat_networking.hpp @@ -19,19 +19,19 @@ namespace chat struct receive_policy_stdout { static void message_do_what(chat_message msg) - { std::cout << msg << '\n'; } + { std::cout << msg.get_content() << '\n'; } static void handshake_do_what(chat_message msg) - { std::cout << "Handshake üzenetek:\n" << msg << '\n'; } + { std::cout << "Handshake üzenetek:\n" << msg.get_content() << '\n'; } static void serverdirection_do_what(chat_message msg) - { std::cout << "Szerver üzenet: " << msg << '\n'; } + { std::cout << "Szerver üzenet: " << msg.get_content() << '\n'; } static void login_do_what(chat_message msg) - { std::cout << msg << " belépett.\n"; } + { std::cout << msg.get_content() << " belépett.\n"; } static void logout_do_what(chat_message msg) - { std::cout << msg << " kilépett.\n"; } + { std::cout << msg.get_content() << " kilépett.\n"; } }; @@ -136,7 +136,7 @@ namespace chat std::getline(_is, data, byte(message::TERM)); throw_if_error(ec); - return data; + return data.substr(1); } void receive()