-
Notifications
You must be signed in to change notification settings - Fork 302
Description
Support required:
1.How can we display the other user’s name (not the author) in One-to-One search results?
2.Any suggestions to improve global search UX across all chat types?
Current Implementation:
We’ve implemented four chat types: All, Flights, Groups, and One-to-One. Channels are created dynamically using a group_type field. For One-to-One chats, we include group_type = "oneToOne" in extraData but do not assign a name.if assign the name the channel name showing two names.
Kotlin:
channelClient.create(memberIds = allMemberIds,extraData = mapOf("group_type" to "groups","name" to groupName,"distinct" to false))
For One-to-One chats, we do not assign a name, but we do include group_type = "oneToOne" in the extraData.
While displaying the channels under each respective tab, we use filters like:
Kotlin:
val filter = Filters.and(Filters.in
("members", listOf(client.getCurrentUser()!!.id)),Filters.eq("group_type", "flights"))
The challenge we are facing arises during global search functionality across all chat types (channels and messages). When searching for messages, the current implementation only returns the author’s name—i.e., the user who sent the message.
In the case of One-to-One conversations, we would like the search results to display the opposite participant’s name (the other user in the channel). For example, **
** regardless of who authored the message—similar to how messaging apps like WhatsApp display search results.
We currently use the following filter for One-to-One chat search:
Kotlin: val filters: FilterObject = Filters.and(Filters.eq("type", "messaging"),Filters.eq("group_type", "oneToOne"),Filters.autocomplete("member.user.name", query))
val request = QueryChannelsRequest( filter = filters, limit = 30, querySort = descByName("lastMessageAt"), memberLimit = 2)
refrenece image its only showing kavya name