]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Utility functions for people tags
authorShashi Gowda <connect2shashi@gmail.com>
Sun, 6 Mar 2011 18:03:39 +0000 (23:33 +0530)
committerShashi Gowda <connect2shashi@gmail.com>
Sun, 6 Mar 2011 18:03:39 +0000 (23:33 +0530)
lib/default.php
lib/framework.php
lib/util.php

index c612557d69100c2264ba5d3d61bbcc8dacb3a503..40372e756b6a731e2c683687c7d3561b8b3f4d4b 100644 (file)
@@ -269,6 +269,11 @@ $default =
         'group' =>
         array('maxaliases' => 3,
               'desclimit' => null),
+        'peopletag' =>
+        array('maxtags' => 100, // maximum number of tags a user can create.
+              'maxpeople' => 500, // maximum no. of people with the same tag by the same user
+              'allow_tagging' => array('all' => true), // equivalent to array('local' => true, 'remote' => true)
+              'desclimit' => null),
         'oohembed' => array('endpoint' => 'http://oohembed.com/oohembed/'),
         'search' =>
         array('type' => 'fulltext'),
index 350a1c268d047b7af61d0e499b1de6ca31313624..b624e312e17511d5c332c08be7e7fadcc0d6cc39 100644 (file)
@@ -45,6 +45,7 @@ define('NOTICE_INBOX_SOURCE_SUB', 1);
 define('NOTICE_INBOX_SOURCE_GROUP', 2);
 define('NOTICE_INBOX_SOURCE_REPLY', 3);
 define('NOTICE_INBOX_SOURCE_FORWARD', 4);
+define('NOTICE_INBOX_SOURCE_PROFILE_TAG', 5);
 define('NOTICE_INBOX_SOURCE_GATEWAY', -1);
 
 # append our extlib dir as the last-resort place to find libs
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));