git » sdk » commit 3cffc8a

Allow accepting a single session

author Stephen Paul Weber
2024-06-19 15:02:23 UTC
committer Stephen Paul Weber
2024-06-19 15:02:23 UTC
parent b2dcdafbebc1b79e1fb33ee1b01d2e388debe2a1

Allow accepting a single session

Maybe I meant that you should always use chat.acceptCall() but we allow
hangup of just one, and the session is what is passed, so let's allow
this for now.

snikket/jingle/Session.hx +2 -4

diff --git a/snikket/jingle/Session.hx b/snikket/jingle/Session.hx
index 94769db..974b9e5 100644
--- a/snikket/jingle/Session.hx
+++ b/snikket/jingle/Session.hx
@@ -17,8 +17,7 @@ interface Session {
 	public var sid (get, null): String;
 	@:allow(snikket)
 	private function initiate(stanza: Stanza): InitiatedSession;
-	@:allow(snikket)
-	private function accept(): Void;
+	public function accept(): Void;
 	public function hangup(): Void;
 	@:allow(snikket)
 	private function retract(): Void;
@@ -281,8 +280,7 @@ class InitiatedSession implements Session {
 		trace("Tried to retract session in wrong state: " + sid, this);
 	}
 
-	@:allow(snikket)
-	private function accept() {
+	public function accept() {
 		if (accepted || remoteDescription == null) return;
 		accepted = true;
 		final audio = remoteDescription.media.find((m) -> m.media == "audio") != null;