Try to fetch full status before getting in_reply_to_id

This commit is contained in:
tastytea 2018-05-18 21:02:15 +02:00
джерело 6da8c1ca07
коміт 784dc4269a
Підписано: tastytea
Ідентифікатор GPG ключа: 59346E0EA35C67E5
2 змінених файлів з 13 додано та 2 видалено

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

@ -195,13 +195,24 @@ const std::uint_fast64_t Listener::get_parent_id(Easy::Notification &notif)
string answer;
std::uint_fast16_t ret;
// Fetch full status
ret = _masto->get(API::v1::search, {{ "q", { notif.status().url() }}},
answer);
if (ret > 0)
{
cerr << "ERROR: " << ret <<
"Could not fetch status (in " << __FUNCTION__ << ")\n";
return 0;
}
ret = _masto->get(API::v1::statuses_id,
{{ "id", { std::to_string(notif.status().id()) }}},
answer);
if (ret > 0)
{
cerr << "ERROR: " << ret << " (in " << __FUNCTION__ << ")\n";
cerr << "ERROR: " << ret <<
"Could not get status (in " << __FUNCTION__ << ")\n";
return 0;
}
else