Skip to content

Metion with "@" shows the the user itself. #5698

Answered by VelikovPetar
zeroarst asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @zeroarst ,

You can achieve something like this by utilising the UserLookupHandler class which handles the user search logic when searching for users to mention. For example:

// Instantiate the default user handler that is used by the SDK
val delegate = DefaultUserLookupHandler(
    chatClient = ChatClient.instance(),
    channelCid = channelId,
)
// Create your own handler, which wraps the default one
val handler = UserLookupHandler { query ->
    // Use the default one to fetch the original results
    val defaultResults = delegate.handleUserLookup(query)
    // Filter the results, so that the current user is excluded from the results
    defaultResults.filter { it.id != ChatClient.i…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by VelikovPetar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
discussion Discuss solutions, possible features, POCs, etc compose Jetpack Compose waiting for response Further information is requested
2 participants