Skip to content

Commit 19eb507

Browse files
committed
Enable getting variable values from websocket condition
1 parent 828a69b commit 19eb507

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/macro-core/macro-condition-websocket.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,17 @@ bool MacroConditionWebsocket::CheckCondition()
5656
for (const auto &msg : *messages) {
5757
if (_regex.Enabled()) {
5858
if (matchRegex(_regex, msg, _message)) {
59+
SetVariableValue(msg);
5960
return true;
6061
}
6162
} else {
6263
if (msg == std::string(_message)) {
64+
SetVariableValue(msg);
6365
return true;
6466
}
6567
}
6668
}
69+
SetVariableValue("");
6770
return false;
6871
}
6972

src/macro-core/macro-condition-websocket.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class MacroConditionWebsocket : public MacroCondition {
1010
public:
11-
MacroConditionWebsocket(Macro *m) : MacroCondition(m) {}
11+
MacroConditionWebsocket(Macro *m) : MacroCondition(m, true) {}
1212
bool CheckCondition();
1313
bool Save(obs_data_t *obj) const;
1414
bool Load(obs_data_t *obj);

0 commit comments

Comments
 (0)