Made sure the description isn't interrupted mid-word

This commit is contained in:
tastytea 2018-02-22 16:48:50 +01:00
parent 56691fbdaa
commit a81a200e9f
Signed by: tastytea
GPG Key ID: 59346E0EA35C67E5
2 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.7)
project (mastorss
VERSION 0.3.0
VERSION 0.3.1
LANGUAGES CXX
)

View File

@ -152,6 +152,7 @@ std::vector<string> parse_website(const string &profile, const string &xml)
if ((str.size() + link.size()) > (std::uint16_t)(max_size - 15))
{
str.resize((max_size - link.size() - 15));
str.resize(str.rfind(' '));
str += " […]";
}
str += "\n\n" + link + "\n\n#bot";