Fix premature "Connected to..." message

This commit is contained in:
tastytea 2018-05-27 12:28:20 +02:00
parent 992f6373ab
commit 6dbddb6df2
Signed by: tastytea
GPG Key ID: 59346E0EA35C67E5
2 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.7) cmake_minimum_required (VERSION 3.7)
project (expandurl-mastodon project (expandurl-mastodon
VERSION 0.7.3 VERSION 0.7.4
LANGUAGES CXX LANGUAGES CXX
) )

View File

@ -115,9 +115,9 @@ const bool Listener::write_config()
const void Listener::start() const void Listener::start()
{ {
static std::uint_fast16_t ret = 0;
_thread = std::thread([=] _thread = std::thread([=]
{ {
std::uint_fast16_t ret = 0;
_running = true; _running = true;
Easy masto(_instance, _access_token); Easy masto(_instance, _access_token);
masto.set_useragent(static_cast<const string>("expandurl-mastodon/") + masto.set_useragent(static_cast<const string>("expandurl-mastodon/") +
@ -137,8 +137,12 @@ const void Listener::start()
{ {
std::this_thread::sleep_for(std::chrono::milliseconds(100)); std::this_thread::sleep_for(std::chrono::milliseconds(100));
} }
if (ret == 0)
{
syslog(LOG_NOTICE, "Connected to %s", _instance.c_str()); syslog(LOG_NOTICE, "Connected to %s", _instance.c_str());
} }
}
const void Listener::stop() const void Listener::stop()
{ {