git » sdk » commit 7daa58c

Allow checking if a discovered chat can call

author Stephen Paul Weber
2026-04-24 02:07:04 UTC
committer Stephen Paul Weber
2026-04-24 02:07:04 UTC
parent 1c878925eb29757aa97a590786efd6973f237685

Allow checking if a discovered chat can call

This only really makes sense with gateways, but still

borogove/Chat.hx +20 -0

diff --git a/borogove/Chat.hx b/borogove/Chat.hx
index 940627d..576c9d7 100644
--- a/borogove/Chat.hx
+++ b/borogove/Chat.hx
@@ -2171,6 +2171,26 @@ class AvailableChat {
 		return caps.isChannel(chatId);
 	}
 
+	/**
+		Can audio calls be started after starting this Chat?
+	**/
+	public function canAudioCall():Bool {
+#if !NO_JINGLE
+		if (caps.features?.contains("urn:xmpp:jingle:apps:rtp:audio") ?? false) return true;
+#end
+		return false;
+	}
+
+	/**
+		Can video calls be started after starting Chat?
+	**/
+	public function canVideoCall():Bool {
+#if !NO_JINGLE
+		if (caps.features?.contains("urn:xmpp:jingle:apps:rtp:video") ?? false) return true;
+#end
+		return false;
+	}
+
 	@:allow(borogove)
 	private function new(chatId: String, displayName: Null<String>, note: String, caps: Caps) {
 		this.chatId = chatId;