Override autocomplete provided by module to not suggest current user(self) I hope it's pretty clear from my question title itself. I want to override autocomplete provided by module such as privatemessage to not suggest the current user(self) who is trying to send message.
I tried doing some research about it but all I got was about overriding JS file.

I have used automcomplete with my custom form long ago &amp; when I prepared the JSON, I removed current user from the list. But what to do if I have to do the same for some contributed module ?
If you look at the code in Privatemsg module, the autocomplete callback function provides a hook hook_privatemsg_autocomplete_alter(). You can use this hook and unset the current logged in user from the $matches array.

I don't have Privatemsg module installed in any of my current projects, so I cannot test it, but the following code should do it:

function YOURMODULE_privatemsg_autocomplete_alter(&amp;$matches, $names, $fragment) {
  global $user;
  unset($matches[$user-&gt;uid]);
}