Add option to disable Twitch event timestamp verification
Some checks are pending
debian-build / build (push) Waiting to run
Check locale / ubuntu64 (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions

This commit is contained in:
WarmUpTill
2025-04-30 23:19:17 +02:00
committed by WarmUpTill
parent 0643b250e1
commit 9633a61a65
5 changed files with 31 additions and 2 deletions

View File

@@ -127,6 +127,11 @@ void EventSub::ClearActiveSubscriptions()
_activeSubscriptions.clear();
}
void EventSub::EnableTimestampValidation(bool enable)
{
_validateTimestamps = enable;
}
void EventSub::Disconnect()
{
std::lock_guard<std::mutex> lock(_connectMtx);
@@ -318,7 +323,7 @@ void EventSub::OnMessage(connection_hdl, EventSubWSClient::message_ptr message)
OBSDataAutoRelease metadata = obs_data_get_obj(json, "metadata");
std::string timestamp =
obs_data_get_string(metadata, "message_timestamp");
if (!isValidTimestamp(timestamp)) {
if (_validateTimestamps && !isValidTimestamp(timestamp)) {
blog(LOG_WARNING,
"Discarding Twitch EventSub with invalid timestamp %s",
timestamp.c_str());