]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
add scope limit flags to some notices in createsim.php
authorEvan Prodromou <evan@status.net>
Sat, 26 Mar 2011 20:06:17 +0000 (16:06 -0400)
committerEvan Prodromou <evan@status.net>
Sat, 26 Mar 2011 20:06:17 +0000 (16:06 -0400)
scripts/createsim.php

index 3244cda104708dae8e897e8c09425136ab624abb..b460be1dd22609c7e854adcd69a4b573fd5a6cc4 100644 (file)
@@ -71,7 +71,7 @@ function newNotice($i, $tagmax)
 {
     global $userprefix;
 
-    $options = array();
+    $options = array('scope' => common_config('notice', 'defaultscope'));
 
     $n = rand(0, $i - 1);
     $user = User::staticGet('nickname', sprintf('%s%d', $userprefix, $n));
@@ -95,6 +95,10 @@ function newNotice($i, $tagmax)
                 $rprofile = $notices->getProfile();
                 $content = "@".$rprofile->nickname." ".$content;
             }
+            $private_to_addressees = rand(0, 4);
+            if ($private_to_addressees == 0) {
+                $options['scope'] |= Notice::ADDRESSEE_SCOPE;
+            }
         }
     }
 
@@ -120,9 +124,19 @@ function newNotice($i, $tagmax)
             }
             $options['groups'] = array($groups->id);
             $content = "!".$groups->nickname." ".$content;
+            $private_to_group = rand(0, 2);
+            if ($private_to_group == 0) {
+                $options['scope'] |= Notice::GROUP_SCOPE;
+            }
         }
     }
 
+    $private_to_site = rand(0, 4);
+
+    if ($private_to_site == 0) {
+        $options['scope'] |= Notice::SITE_SCOPE;
+    }
+
     $notice = Notice::saveNew($user->id, $content, 'system', $options);
 }