Commit 47b3fdf0 authored by Evan Prodromou's avatar Evan Prodromou

add scope limit flags to some notices in createsim.php

parent c7f866b0
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment