]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/util.php
Utility functions for people tags
[quix0rs-gnu-social.git] / lib / util.php
index 9f84e3120a25aa0d3dcd6dfff6a8960ae7dec0c9..2e6768f90e34448d15c7781438b04e193aaf1fb9 100644 (file)
@@ -753,17 +753,19 @@ function common_find_mentions($text, $notice)
         foreach ($hmatches[1] as $hmatch) {
 
             $tag = common_canonical_tag($hmatch[0]);
-
-            $tagged = Profile_tag::getTagged($sender->id, $tag);
-
-            $url = common_local_url('subscriptions',
-                                    array('nickname' => $sender->nickname,
-                                          'tag' => $tag));
-
-            $mentions[] = array('mentioned' => $tagged,
-                                'text' => $hmatch[0],
-                                'position' => $hmatch[1],
-                                'url' => $url);
+            $plist = Profile_list::getByTaggerAndTag($sender->id, $tag);
+            if (!empty($plist) && !$plist->private) {
+                $tagged = $sender->getTaggedSubscribers($tag);
+
+                $url = common_local_url('showprofiletag',
+                                        array('tagger' => $sender->nickname,
+                                              'tag' => $tag));
+
+                $mentions[] = array('mentioned' => $tagged,
+                                    'text' => $hmatch[0],
+                                    'position' => $hmatch[1],
+                                    'url' => $url);
+            }
         }
 
         Event::handle('EndFindMentions', array($sender, $text, &$mentions));