git » sdk » commit 3658a78

Store updates using the update storage helper

author Stephen Paul Weber
2026-05-26 21:05:43 UTC
committer Stephen Paul Weber
2026-05-26 21:05:43 UTC
parent 13a7a005f3bc5a3abd51f9b715f40b0873f88046

Store updates using the update storage helper

borogove/Chat.hx +5 -7

diff --git a/borogove/Chat.hx b/borogove/Chat.hx
index 80e3b74..d6cd173 100644
--- a/borogove/Chat.hx
+++ b/borogove/Chat.hx
@@ -1641,18 +1641,16 @@ class Channel extends Chat {
 		}
 		final occupantId = (presence : Stanza).getChild("occupant-id", "urn:xmpp:occupant-id:0")?.attr?.get("id");
 		if (!noStore && !(disco.features.contains("urn:xmpp:occupant-id:0") && member.id != chatId + "/" + occupantId)) {
-			(if (presence.type == "unavailable" && member.photoUri == null) {
+			if (presence.type == "unavailable" && member.photoUri == null) {
 				final memberUpdates = MemberUpdate.extractUpdates(client.accountId(), this, presence);
-				getMemberDetails([member.id]).then(fetched ->
-					cast memberUpdates[0].applyTo(fetched[0])
-				);
+				persistence.storeMemberUpdates(client.accountId(), this, memberUpdates, false).then(members -> {
+					trigger("members/update", members);
+				});
 			} else {
-				Promise.resolve(member);
-			}).then(member -> {
 				persistence.storeMembers(client.accountId(), chatId, [member]).then(_ -> {
 					trigger("members/update", [member]);
 				});
-			});
+			}
 		}
 		final mucUser = (presence : Stanza).getChild("x", "http://jabber.org/protocol/muc#user");
 		if (mucUser != null) {