Don't cut in the middle of a word.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
937b08ff85
commit
94ca8bffaf
|
@ -70,6 +70,14 @@ void MastoAPI::post_item(const Item &item)
|
||||||
if ((len + len_append) > len_max)
|
if ((len + len_append) > len_max)
|
||||||
{
|
{
|
||||||
status.resize(len_max - len_append - omission.size());
|
status.resize(len_max - len_append - omission.size());
|
||||||
|
|
||||||
|
// Don't cut in the middle of a word.
|
||||||
|
const auto pos = status.rfind(' ');
|
||||||
|
if (pos != string::npos)
|
||||||
|
{
|
||||||
|
status.resize(status.size() - pos);
|
||||||
|
}
|
||||||
|
|
||||||
status.append(omission);
|
status.append(omission);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue