git » sdk » commit cf2ea89

Remove call from chat when done

author Stephen Paul Weber
2025-10-29 19:40:48 UTC
committer Stephen Paul Weber
2025-10-29 19:40:48 UTC
parent efe57ff67a0ba51014549ab0fcf953e52ddb91d8

Remove call from chat when done

borogove/calls/Session.hx +3 -2

diff --git a/borogove/calls/Session.hx b/borogove/calls/Session.hx
index 5a4e1d7..aaa769d 100644
--- a/borogove/calls/Session.hx
+++ b/borogove/calls/Session.hx
@@ -103,7 +103,7 @@ class IncomingProposedSession implements Session {
 		client.storeMessages([msg]).then((stored) -> {
 			client.notifyMessageHandlers(stored[0], CorrectionEvent);
 		});
-		client.getDirectChat(from.asBare().asString(), false).jingleSessions.remove(sid);
+		client.getChat(chatId)?.jingleSessions.remove(sid);
 		client.trigger("call/retract", { chatId: chatId, sid: sid });
 	}
 
@@ -239,7 +239,7 @@ class OutgoingProposedSession implements Session {
 			);
 			client.notifyMessageHandlers(stored[0], CorrectionEvent);
 		});
-		client.getDirectChat(to.asBare().asString(), false).jingleSessions.remove(sid);
+		client.getChat(chatId)?.jingleSessions.remove(sid);
 		client.trigger("call/retract", { chatId: chatId, sid: sid });
 	}
 
@@ -429,6 +429,7 @@ class InitiatedSession implements Session {
 					.tag("store", { xmlns: "urn:xmpp:hints" })
 			);
 		});
+		client.getChat(chatId)?.jingleSessions.remove(sid);
 	}
 
 	@:allow(borogove)