Try to fetch full status before getting in_reply_to_id
This commit is contained in:
parent
6da8c1ca07
commit
784dc4269a
|
@ -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
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -195,13 +195,24 @@ const std::uint_fast64_t Listener::get_parent_id(Easy::Notification ¬if)
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue