matrix-android-sdk
matrix-android-sdk copied to clipboard
user search does not retrieve all users in system
if I am logged in using username : james password : 123456 users that comes from martix server are
Sameh/@Sameh:domain.com Walid/@walid:domain.com madonna/@MADONNA:domain.com
if I am logged in using username : john password : 123456 users that comes from martix server are
Sameh/@Sameh:domain.com Walid/@walid:domain.com madonna/@MADONNA:domain.com Habib/@habib:domain.com elias/@elias:domain.com nour/@nour:domain.com wiliam/@wiliam:domain.com
if I am logged in using username : nour password : 123456 users that comes from martix server are
john/@john:domain.com Sameh/@Sameh:domain.com Walid/@walid:domain.com madonna/@MADONNA:domain.com elias/@elias:domain.com wiliam/@wiliam:domain.com
why that could happen?
I am using getSession(context).eventsApiClient.searchUsers("domain", 100, null, userFoundCallback) in android matrix sdk
According to https://matrix.org/docs/spec/client_server/latest#post-matrix-client-r0-user-directory-search, the users returned depends on the fact that the logged user shares room(s) with them:
The homeserver may determine which subset of users are searched, however the homeserver MUST at a minimum consider the users the requesting user shares a room with and those who reside in public rooms (known to the homeserver). The search MUST consider local users to the homeserver, and SHOULD query remote users as part of the search.