]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - scripts/createsim.php
Merge commit 'refs/merge-requests/199' of git://gitorious.org/statusnet/mainline...
[quix0rs-gnu-social.git] / scripts / createsim.php
index 9de855ee54cdd8b731f7f02703697332f2f1c3ac..afd46b9c6e9dd17163b94fdb6bb6735a6c5396c2 100644 (file)
@@ -95,7 +95,7 @@ function newNotice($i, $tagmax)
     $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);
@@ -118,7 +118,7 @@ function newNotice($i, $tagmax)
         $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);
@@ -163,7 +163,7 @@ function newNotice($i, $tagmax)
 
     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++) {
@@ -235,11 +235,11 @@ function newSub($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();