]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Autocomplete: don't match non-subscribed group-names.
authorJoshua Judson Rosen <rozzin@geekspace.com>
Wed, 30 Apr 2014 03:35:46 +0000 (23:35 -0400)
committerMikael Nordfeldth <mmn@hethane.se>
Mon, 5 May 2014 11:32:18 +0000 (13:32 +0200)
There's no point, since we can't post/link to them anyway.

plugins/Autocomplete/actions/autocomplete.php

index c6676250c043185330c9ce3389dca7ef55249870..2c5bbb41a677d5418a3fbae5de4e6cc46f238d9a 100644 (file)
@@ -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);