Validate that user id matches token

This commit is contained in:
WarmUpTill
2026-03-17 20:36:53 +01:00
committed by WarmUpTill
parent bf216e0917
commit bf18d8e106
8 changed files with 147 additions and 52 deletions

View File

@@ -1096,6 +1096,12 @@ void MacroConditionTwitch::AddChannelGenericEventSubscription(
return;
}
const auto id = token->GetUserID();
if (!id) {
vblog(LOG_INFO, "%s skip - invalid user id", __func__);
return;
}
const auto channelID = _channel.GetUserID(*token);
if (!TwitchChannel::IsValid(channelID)) {
vblog(LOG_INFO, "skip %s because of invalid channel selection",
@@ -1114,7 +1120,7 @@ void MacroConditionTwitch::AddChannelGenericEventSubscription(
if (includeModeratorId) {
obs_data_set_string(condition, "moderator_user_id",
token->GetUserID().c_str());
id->c_str());
}
obs_data_apply(condition, extraConditions);