feat(eventsub): reconnect (#6035)

This commit is contained in:
nerix
2025-03-06 22:41:35 +01:00
committed by GitHub
parent 9d1f930e85
commit 914257d537
18 changed files with 305 additions and 45 deletions
@@ -42,8 +42,23 @@ boost::json::result_for<Payload, boost::json::value>::type tag_invoke(
return id.error();
}
std::optional<std::string> reconnectURL = std::nullopt;
const auto *jvreconnectURL = root.if_contains("reconnect_url");
if (jvreconnectURL != nullptr && !jvreconnectURL->is_null())
{
auto treconnectURL =
boost::json::try_value_to<std::string>(*jvreconnectURL);
if (treconnectURL.has_error())
{
return treconnectURL.error();
}
reconnectURL = std::move(treconnectURL.value());
}
return Payload{
.id = std::move(id.value()),
.reconnectURL = std::move(reconnectURL),
};
}