Append link adter resizing. 🤦
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
2099f48cef
commit
d7fb71dc95
|
@ -53,9 +53,8 @@ void MastoAPI::post_item(const Item &item)
|
||||||
}
|
}
|
||||||
return s;
|
return s;
|
||||||
}()};
|
}()};
|
||||||
status.append("\n\n" + item.link);
|
|
||||||
|
|
||||||
const size_t len_status{status.size()};
|
const size_t len_status{status.size() + item.link.size() + 2};
|
||||||
const size_t len_append{[&]
|
const size_t len_append{[&]
|
||||||
{
|
{
|
||||||
if (_profile.append.empty())
|
if (_profile.append.empty())
|
||||||
|
@ -78,7 +77,6 @@ void MastoAPI::post_item(const Item &item)
|
||||||
if ((len_status + len_append) > len_max)
|
if ((len_status + len_append) > len_max)
|
||||||
{
|
{
|
||||||
status.resize(len_max - len_append - omission.size());
|
status.resize(len_max - len_append - omission.size());
|
||||||
BOOST_LOG_TRIVIAL(debug) << "Status resized to: " << status.size();
|
|
||||||
|
|
||||||
// Don't cut in the middle of a word.
|
// Don't cut in the middle of a word.
|
||||||
const auto pos = status.rfind(' ');
|
const auto pos = status.rfind(' ');
|
||||||
|
@ -91,6 +89,8 @@ void MastoAPI::post_item(const Item &item)
|
||||||
BOOST_LOG_TRIVIAL(debug) << "Status resized to: " << status.size();
|
BOOST_LOG_TRIVIAL(debug) << "Status resized to: " << status.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
status.append("\n\n" + item.link);
|
||||||
|
|
||||||
if (!_profile.append.empty())
|
if (!_profile.append.empty())
|
||||||
{
|
{
|
||||||
status.append("\n\n" + _profile.append);
|
status.append("\n\n" + _profile.append);
|
||||||
|
|
Loading…
Reference in New Issue