diff options
author | Robert Pösel <robyer@seznam.cz> | 2017-03-05 15:05:51 +0100 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2017-03-05 15:06:02 +0100 |
commit | da611f505c0e9a8d8476de272967891efba48872 (patch) | |
tree | 9c3b2ea1ca752b9a3628748fafa6cd78dbb0b101 /utils/std_string_utils.cpp | |
parent | 5417b1e4a79c86ac64cb3f84cde17eec2e0d0c87 (diff) |
Facebook: Fix reseting chat name
When user changed thread name from website and set it to "", in Miranda it previously stay "". Now it correctly generates new name from participant names.
Diffstat (limited to 'utils/std_string_utils.cpp')
-rw-r--r-- | utils/std_string_utils.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/utils/std_string_utils.cpp b/utils/std_string_utils.cpp index dc763524f3..49cda52844 100644 --- a/utils/std_string_utils.cpp +++ b/utils/std_string_utils.cpp @@ -387,19 +387,19 @@ std::string utils::text::source_get_form_data(std::string* data, bool hiddenOnly return values; } -std::wstring utils::text::prepare_name(const std::wstring &name, bool withSurnameLetter) +std::string utils::text::prepare_name(const std::string &name, bool withSurnameLetter) { - std::wstring::size_type pos = name.find(L" "); + std::string::size_type pos = name.find(" "); if (pos == std::wstring::npos) return name; - std::wstring result = name.substr(0, pos); + std::string result = name.substr(0, pos); if (withSurnameLetter) { - pos = name.rfind(L" ") + 1; // we're sure there is some space in name so we can do +1 safely + pos = name.rfind(" ") + 1; // we're sure there is some space in name so we can do +1 safely if (pos < name.length()) - result += L" " + name.substr(pos, 1) + std::wstring(L"."); + result += " " + name.substr(pos, 1) + std::string("."); } return result; |