[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1795570-chat-br-tags into lp:widelands
The proposal to merge lp:~widelands-dev/widelands/bug-1795570-chat-br-tags into lp:widelands has been updated. Status: Needs review => Merged For more details, see: https://code.launchpad.net/~widelands-dev/widelands/bug-1795570-chat-br-tags/+merge/356653 -- Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1795570-chat-br-tags. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1795570-chat-br-tags into lp:widelands
Review: Approve diff, testing Diff is looking good and /help is printed correctly. Just as a side note since your commit messages indicate otherwise: This also affects all chat messages of users, e.g., I can send "line1line2" and it is printed in two lines. If that is intentionally (or at least acceptable), then this can be merged. -- https://code.launchpad.net/~widelands-dev/widelands/bug-1795570-chat-br-tags/+merge/356653 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1795570-chat-br-tags. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1795570-chat-br-tags into lp:widelands
Continuous integration builds have changed state: Travis build 4118. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/440588155. Appveyor build 3915. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1795570_chat_br_tags-3915. -- https://code.launchpad.net/~widelands-dev/widelands/bug-1795570-chat-br-tags/+merge/356653 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1795570-chat-br-tags into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1795570-chat-br-tags into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1795570-chat-br-tags into lp:widelands. Commit message: Fix br tag in chat server help message Requested reviews: Widelands Developers (widelands-dev) Related bugs: Bug #1795570 in widelands: "Chat /help prints instead of using it" https://bugs.launchpad.net/widelands/+bug/1795570 For more details, see: https://code.launchpad.net/~widelands-dev/widelands/bug-1795570-chat-br-tags/+merge/356653 -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1795570-chat-br-tags into lp:widelands. === modified file 'src/wui/chat_msg_layout.cc' --- src/wui/chat_msg_layout.cc 2018-08-20 19:00:20 + +++ src/wui/chat_msg_layout.cc 2018-10-12 10:30:39 + @@ -19,6 +19,7 @@ #include "wui/chat_msg_layout.h" +#include #include #include "chat/chat.h" @@ -39,6 +40,13 @@ return "99"; } +std::string sanitize_message(const std::string& given_text) { + std::string result = richtext_escape(given_text); + // Preserve br tag + boost::replace_all(result, "br", ""); + return result; +} + } // namespace // Returns a richtext string that can be displayed to the user. @@ -46,7 +54,7 @@ const std::string& font_face = "serif"; std::string message = ""; - std::string sanitized = richtext_escape(chat_message.msg); + const std::string sanitized = sanitize_message(chat_message.msg); // time calculation char ts[13]; @@ -57,8 +65,8 @@ color(chat_message.playern)) .str(); - std::string sender_escaped = richtext_escape(chat_message.sender); - std::string recipient_escaped = richtext_escape(chat_message.recipient); + const std::string sender_escaped = richtext_escape(chat_message.sender); + const std::string recipient_escaped = richtext_escape(chat_message.recipient); if (chat_message.recipient.size() && chat_message.sender.size()) { // Personal message handling ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp