NextCloud user_ldap filter

I want to make filteration when user search users in chat application to retrieve only users with the same domain and search pattern? I don’t know how to get current user data in user_ldap application . so I tried$this->userSession->getUser(); but it return nothing and when try$this->userSession->getUser()->getEmailAddress it returns null. I tried also OC::$server->getUserSession()->getUser() but the same thing