mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-27 03:36:00 -05:00
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
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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user