$content = testNoticeContent();
if ($is_reply == 0) {
- $stream = new InboxNoticeStream($user, $user->getProfile());
+ $stream = new InboxNoticeStream($user->getProfile(), $user->getProfile());
$notices = $stream->getNotices(0, 20);
if ($notices->N > 0) {
$nval = rand(0, $notices->N - 1);
$is_directed = rand(0, 4);
if ($is_directed == 0) {
- $subs = $user->getSubscriptions(0, 100)->fetchAll();
+ $subs = $user->getSubscribed(0, 100)->fetchAll();
if (count($subs) > 0) {
$seen = array();
$f = rand(0, 9);
if ($in_group == 0) {
$groups = $user->getGroups();
- if ($groups->N > 0) {
+ if ($groups instanceof User_group) {
$gval = rand(0, $groups->N - 1);
$groups->fetch(); // go to 0th
for ($i = 0; $i < $gval; $i++) {
$to = User::getKV('nickname', $tunic);
- if (empty($to)) {
+ if (!($to instanceof User)) {
throw new Exception("Can't find user '$tunic'.");
}
- subs_subscribe_to($from, $to);
+ Subscription::start($from->getProfile(), $to->getProfile());
$from->free();
$to->free();