git » sdk » commit ef25fac

Start in forceLive if this is not a MUC

author Stephen Paul Weber
2024-11-19 20:24:21 UTC
committer Stephen Paul Weber
2024-11-19 20:26:46 UTC
parent e2be8bc6fa0f7bd9f6c5d3b84f7591d0e37b54bf

Start in forceLive if this is not a MUC

snikket/Chat.hx +7 -1

diff --git a/snikket/Chat.hx b/snikket/Chat.hx
index 42c165d..5373a75 100644
--- a/snikket/Chat.hx
+++ b/snikket/Chat.hx
@@ -898,7 +898,13 @@ class Channel extends Chat {
 	@:allow(snikket)
 	private function new(client:Client, stream:GenericStream, persistence:Persistence, chatId:String, uiState = Open, isBlocked = false, extensions = null, readUpToId = null, readUpToBy = null, ?disco: Caps) {
 		super(client, stream, persistence, chatId, uiState, isBlocked, extensions, readUpToId, readUpToBy);
-		if (disco != null) this.disco = disco;
+		if (disco != null) {
+			this.disco = disco;
+			if (!disco.features.contains("http://jabber.org/protocol/muc")) {
+				// Not a MUC, what kind of channel is this?
+				forceLive = true;
+			}
+		}
 	}
 
 	@:allow(snikket)