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
parent 6da8c1ca07
commit 784dc4269a
Signed by: tastytea
GPG Key ID: 59346E0EA35C67E5
2 changed files with 13 additions and 2 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.3.1 VERSION 0.3.2
LANGUAGES CXX LANGUAGES CXX
) )

View File

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