git » sdk » commit 8f567dc

Actually pass the state to the handler

author Stephen Paul Weber
2025-06-24 18:27:54 UTC
committer Stephen Paul Weber
2025-06-24 18:27:54 UTC
parent c7b0fd20acfe694993e1c3b66e886045e23da8f2

Actually pass the state to the handler

snikket/jingle/PeerConnection.cpp.hx +2 -1

diff --git a/snikket/jingle/PeerConnection.cpp.hx b/snikket/jingle/PeerConnection.cpp.hx
index a49649d..ae573ab 100644
--- a/snikket/jingle/PeerConnection.cpp.hx
+++ b/snikket/jingle/PeerConnection.cpp.hx
@@ -857,8 +857,9 @@ class PeerConnection {
 	private function onStateChange(state: cpp.Struct<PCState>) {
 		untyped __cpp__("int base = 0; hx::SetTopOfStack(&base, true);"); // allow running haxe code on foreign thread
 		mainLoop.run(() -> {
+			final stateString = state.toString();
 			for (cb in stateChangeListeners) {
-				cb(null);
+				cb(stateString);
 			}
 		});
 		untyped __cpp__("hx::SetTopOfStack((int*)0, true);"); // unregister with GC