From c256a9a9287bc4ec8ac116e1fe27a15514490df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjist=C3=B3f?= Date: Sun, 4 Dec 2016 14:54:15 +0100 Subject: [PATCH] commandline_chat's policies now get their messages via const reference --- commandline_chat.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/commandline_chat.cpp b/commandline_chat.cpp index b40160f..18471e9 100644 --- a/commandline_chat.cpp +++ b/commandline_chat.cpp @@ -6,25 +6,25 @@ struct receive_policy_stdout { - static void message_do_what(chat::chat_message msg) + static void message_do_what(const chat::chat_message& msg) { std::cout << msg.get_content() << '\n'; } - static void handshake_do_what(chat::chat_message msg) + static void handshake_do_what(const chat::chat_message& msg) { std::cout << "Handshake üzenetek:\n" << msg.get_content() << '\n'; } - static void serverdirection_do_what(chat::chat_message msg) + static void serverdirection_do_what(const chat::chat_message& msg) { std::cout << "Szerver üzenet: " << msg.get_content() << '\n'; } - static void login_do_what(chat::chat_message msg) + static void login_do_what(const chat::chat_message& msg) { std::cout << msg.get_content() << " belépett.\n"; } - static void logout_do_what(chat::chat_message msg) + static void logout_do_what(const chat::chat_message& msg) { std::cout << msg.get_content() << " kilépett.\n"; } }; struct send_policy_stdout { - static bool check_msg_length(chat::chat_message msg) + static bool check_msg_length(const chat::chat_message& msg) { bool good = msg.length() <= (256-34); if (!good)