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 | |
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')
-rw-r--r-- | utils/std_string_utils.cpp | 10 | ||||
-rw-r--r-- | utils/std_string_utils.h | 2 |
2 files changed, 6 insertions, 6 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; diff --git a/utils/std_string_utils.h b/utils/std_string_utils.h index 96ee5ca4d9..2c72e3a918 100644 --- a/utils/std_string_utils.h +++ b/utils/std_string_utils.h @@ -76,7 +76,7 @@ namespace utils std::string truncate_utf8(const std::string &text, size_t maxLength);
void explode(std::string str, const std::string &separator, std::vector<std::string>* results);
void append_ordinal(unsigned long value, std::string* data);
- std::wstring prepare_name(const std::wstring &name, bool withSurnameLetter);
+ std::string prepare_name(const std::string &name, bool withSurnameLetter);
};
namespace conversion
|