From 55453925a156077c80a70a916c429b7301460d16 Mon Sep 17 00:00:00 2001 From: uso Date: Wed, 1 Aug 2007 02:04:34 +0000 Subject: [PATCH] replace the local logic to remove color tags from a user string... ...by font::del_tags() which also does the job if more than one color tag character is used (like for "bold red") --- src/multiplayer_ui.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/multiplayer_ui.cpp b/src/multiplayer_ui.cpp index 666b65109de..f38fcf44f7a 100644 --- a/src/multiplayer_ui.cpp +++ b/src/multiplayer_ui.cpp @@ -353,13 +353,10 @@ void ui::handle_event(const SDL_Event& event) handle_key_event(event.key); } if(users_menu_.double_clicked()) { - std::string usr_text = user_list_[users_menu_.selection()]; - if(usr_text.size() > 1 && usr_text.at(0) == '#') { - usr_text.erase(0,1); - int index = usr_text.find_first_of(' '); - if(index > -1) { - usr_text.erase(index); - } + std::string usr_text = font::del_tags(user_list_[users_menu_.selection()]); + const int index = usr_text.find_first_of(' '); + if (index > -1) { + usr_text.erase(index); } std::string caption = _("Send a private message to ") + usr_text; gui::dialog d(disp(), _("Whisper"), caption, gui::OK_CANCEL);