function privatemsg_filter_query_privatemsg_autocomplete_alter in Privatemsg 7
Same name and namespace in other branches
- 7.2 privatemsg_filter/privatemsg_filter.module \privatemsg_filter_query_privatemsg_autocomplete_alter()
Limit the user autocomplete for the filter widget.
File
- privatemsg_filter/
privatemsg_filter.module, line 877 - Allows users to tag private messages and to filter based upon those tags.
Code
function privatemsg_filter_query_privatemsg_autocomplete_alter($query) {
global $user;
if (arg(1) == 'filter') {
$query
->join('pm_index', 'pip', "pip.recipient = u.uid AND pip.type = 'user'");
$query
->join('pm_index', 'piu', "piu.recipient = :uid_index AND piu.type = 'user' AND pip.mid = piu.mid", array(
':uid_index' => $user->uid,
));
}
}