]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - scripts/createsim.php
Make better use of Subscription class
[quix0rs-gnu-social.git] / scripts / createsim.php
index 9de855ee54cdd8b731f7f02703697332f2f1c3ac..78bc5a1f8987aaf7608194ed016fbb22af10e259 100644 (file)
@@ -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();