Browse Source

Try to fetch full status before getting in_reply_to_id

tags/0.4.0
tastytea 2 years ago
parent
commit
784dc4269a
Signed by: tastytea GPG Key ID: 59346E0EA35C67E5
2 changed files with 13 additions and 2 deletions
  1. +1
    -1
      CMakeLists.txt
  2. +12
    -1
      src/masto.cpp

+ 1
- 1
CMakeLists.txt View File

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



+ 12
- 1
src/masto.cpp View File

@@ -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


Loading…
Cancel
Save