From f33700c70aaf3d690fd98d638a2457479aea9db7 Mon Sep 17 00:00:00 2001 From: Gunter Labes Date: Fri, 3 Apr 2009 07:48:18 +0000 Subject: [PATCH] patch #1153: fix for bug #13302 - truncate chatlog to 256 messages instead of 1024 from cornmander (Gregory Shikhman) --- src/multiplayer_ui.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/multiplayer_ui.cpp b/src/multiplayer_ui.cpp index 406b5704c92..fe783168642 100644 --- a/src/multiplayer_ui.cpp +++ b/src/multiplayer_ui.cpp @@ -33,6 +33,8 @@ #define LOG_NW LOG_STREAM(info, network) #define ERR_NW LOG_STREAM(err, network) +#define MAX_MESSAGES 256 + namespace { class user_menu_style : public gui::menu::imgsel_style { @@ -203,7 +205,7 @@ void chat::add_message(const time_t& time, const std::string& user, { message_history_.push_back(msg(time, user, message)); - while (message_history_.size() > 1024) { + while (message_history_.size() > MAX_MESSAGES) { message_history_.pop_front(); if (last_update_ > 0)