function pm_block_user_privatemsg_autocomplete_alter

7-1 pm_block_user.module pm_block_user_privatemsg_autocomplete_alter(&$matches, $names, $fragment)
7-2 pm_block_user.module pm_block_user_privatemsg_autocomplete_alter(&$matches, $names, $fragment)
6-2 pm_block_user.module pm_block_user_privatemsg_autocomplete_alter(&$matches, $names, $fragment)

File

pm_block_user/pm_block_user.module, line 100
Allows users to block other users from sending them any messages

Code

function pm_block_user_privatemsg_autocomplete_alter(&$matches, $names, $fragment) {
  // Remove all types other than user if accessed through
  // messages/user/autocomplete.
  if (arg(1) == 'user') {
    foreach ($matches as $id => $match) {
      if ($match->type != 'user') {
        unset($matches[$id]);
      }
    }
  }
}