]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'testing' of gitorious.org:statusnet/mainline into testing
authorBrion Vibber <brion@pobox.com>
Mon, 7 Feb 2011 20:20:12 +0000 (12:20 -0800)
committerBrion Vibber <brion@pobox.com>
Mon, 7 Feb 2011 20:20:12 +0000 (12:20 -0800)
1  2 
plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php

index 9468423bed55498f34d3d42f138e49774bc3c49e,6a58ec3e21d585c7608325b809eb370d02ce9087..09fd1d7bfa19cd496fa8b20802b9dc2095ddb7c2
@@@ -391,10 -391,8 +391,10 @@@ class GroupPrivateMessagePlugin extend
  
          // Look for group tags
          // FIXME: won't work for remote groups
 +        // @fixme if Notice::saveNew is refactored so we can just pull its list
 +        // of groups between processing and saving, make use of it
  
 -        $count = preg_match_all('/(?:^|\s)!([A-Za-z0-9]{1,64})/',
 +        $count = preg_match_all('/(?:^|\s)!(' . Nickname::DISPLAY_FMT . ')/',
                                  strtolower($notice->content),
                                  $match);
  
          
          return true;
      }
-  
+     /**
+      * Show an indicator that the group is (essentially) private on the group page
+      *
+      * @param Action     $action The action being shown
+      * @param User_group $group  The group being shown
+      *
+      * @return boolean hook value
+      */
+     function onEndGroupProfileElements($action, $group)
+     {
+         $gps = Group_privacy_settings::forGroup($group);
+         
+         if ($gps->allow_privacy == Group_privacy_settings::ALWAYS) {
+             $action->element('p', 'privategroupindicator', _('Private'));
+         }
+         return true;
+     }
+     function onStartShowExportData($action)
+     {
+         if ($action instanceof ShowgroupAction) {
+             $gps = Group_privacy_settings::forGroup($action->group);
+         
+             if ($gps->allow_privacy == Group_privacy_settings::ALWAYS) {
+                 return false;
+             }
+         }
+         return true;
+     }
      function onPluginVersion(&$versions)
      {
          $versions[] = array('name' => 'GroupPrivateMessage',