git » sdk » commit 68b4b9f

Search MUC participants

author Stephen Paul Weber
2026-04-27 01:24:33 UTC
committer Stephen Paul Weber
2026-04-27 01:24:33 UTC
parent b64cff41779dc57e9d5551ef55d8f15c9dacdda5

Search MUC participants

borogove/AvailableChatIterator.hx +7 -0
borogove/Chat.hx +4 -3

diff --git a/borogove/AvailableChatIterator.hx b/borogove/AvailableChatIterator.hx
index ec617b5..d0a9f0d 100644
--- a/borogove/AvailableChatIterator.hx
+++ b/borogove/AvailableChatIterator.hx
@@ -75,6 +75,13 @@ class AvailableChatIterator {
 					final channel = Util.downcast(chat, Channel);
 					results.push(Promise.resolve(new AvailableChat(chat.chatId, chat.getDisplayName(), chat.chatId, channel == null || channel.disco == null ? new Caps("", [], [], []) : channel.disco)));
 				}
+
+				for (p in chat.getParticipants()) {
+					final details = chat.getParticipantDetails(p);
+					if (details.chat != null && (details.chat.chatId.contains(query.toLowerCase()) || (details.chat.displayName ?? "").toLowerCase().contains(query.toLowerCase()))) {
+						results.push(Promise.resolve(details.chat));
+					}
+				}
 			}
 			if (chat.isTrusted()) {
 				final resources:Map<String, Bool> = [];
diff --git a/borogove/Chat.hx b/borogove/Chat.hx
index 576c9d7..aa61bfa 100644
--- a/borogove/Chat.hx
+++ b/borogove/Chat.hx
@@ -1038,7 +1038,7 @@ class DirectChat extends Chat {
 			chat.chatId == client.accountId(),
 			[], // No roles in direct chat
 			JID.parse(participantId),
-			new AvailableChat(participantId, chat.getDisplayName(), "", new Caps("", [], [], []))
+			new AvailableChat(participantId, chat.getDisplayName(), '${participantId} (via ${displayName})', new Caps("", [], [], []))
 		);
 	}
 
@@ -1762,10 +1762,11 @@ trace("XYZZY no MUC avatar locally matching so fetch vcard", chatId, avatarSha1H
 				true,
 				roles,
 				JID.parse(chat.chatId),
-				new AvailableChat(chat.chatId, chat.getDisplayName(), "", new Caps("", [], [], []))
+				new AvailableChat(chat.chatId, chat.getDisplayName(), chat.chatId, new Caps("", [], [], []))
 			);
 		} else {
 			final placeholderUri = Color.defaultPhoto(participantId, nick == null ? " " : nick.charAt(0));
+			final trueJid = ppresence?.mucUser?.jid?.asBare()?.asString();
 			return new Participant(
 				nick ?? "",
 				ppresence?.avatarHash?.toUri(),
@@ -1773,7 +1774,7 @@ trace("XYZZY no MUC avatar locally matching so fetch vcard", chatId, avatarSha1H
 				false,
 				roles,
 				jid,
-				ppresence?.mucUser?.jid == null ? null : new AvailableChat(ppresence.mucUser.jid.asBare().asString(), nick ?? "", "", new Caps("", [], [], []))
+				trueJid == null ? null : new AvailableChat(trueJid, nick ?? "", '$trueJid (via ${displayName})', new Caps("", [], [], []))
 			);
 		}
 	}