From: Joshua Judson Rosen Date: Wed, 30 Apr 2014 03:35:46 +0000 (-0400) Subject: Autocomplete: don't match non-subscribed group-names. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4fd3f43ad266839399d9b9bf03d3031671d78d72;p=quix0rs-gnu-social.git Autocomplete: don't match non-subscribed group-names. There's no point, since we can't post/link to them anyway. --- diff --git a/plugins/Autocomplete/actions/autocomplete.php b/plugins/Autocomplete/actions/autocomplete.php index c6676250c0..2c5bbb41a6 100644 --- a/plugins/Autocomplete/actions/autocomplete.php +++ b/plugins/Autocomplete/actions/autocomplete.php @@ -128,6 +128,9 @@ class AutocompleteAction extends Action $group = new User_group(); $group->limit($limit); $group->whereAdd('nickname like \'' . trim($group->escape($term), '\'') . '%\''); + //Can't post to groups we're not subscribed to...: + $group->whereAdd('id in (SELECT group_id from group_member' + . ' where profile_id = ' . $cur->id . ')'); if($group->find()){ while($group->fetch()) { $this->groups[]=clone($group);