git » sdk » commit 2ed0e68

Don't bother storing the MUC until we've joined

author Stephen Paul Weber
2025-03-04 16:47:41 UTC
committer Stephen Paul Weber
2025-03-04 16:47:41 UTC
parent 31a865595d62c293e9745f805c6877272dc90a01

Don't bother storing the MUC until we've joined

snikket/Client.hx +1 -1

diff --git a/snikket/Client.hx b/snikket/Client.hx
index 8e5151a..bc5fb97 100644
--- a/snikket/Client.hx
+++ b/snikket/Client.hx
@@ -471,7 +471,7 @@ class Client extends EventEmitter {
 				} else {
 					final handleCaps = (caps) -> {
 						chat.setPresence(JID.parse(stanza.attr.get("from")).resource, new Presence(caps, mucUser));
-						persistence.storeChats(accountId(), [chat]);
+						if (mucUser == null || chat.livePresence()) persistence.storeChats(accountId(), [chat]);
 						return chat;
 					};