]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/User.php
Make better use of Subscription class
[quix0rs-gnu-social.git] / classes / User.php
index cc6e55d1bde3ab936829102e19560b08024c6ed8..c3e1d29827e245240989eef0123a7fa66c4507bb 100644 (file)
@@ -475,8 +475,15 @@ class User extends Managed_DataObject
 
         if ($invites->find()) {
             while ($invites->fetch()) {
-                $other = User::getKV($invites->user_id);
-                subs_subscribe_to($other, $this);
+                try {
+                    $other = Profile::getKV('id', $invites->user_id);
+                    if (!($other instanceof Profile)) {    // remove when getKV throws exceptions
+                        continue;
+                    }
+                    Subscription::start($other, $this->getProfile());
+                } catch (Exception $e) {
+                    continue;
+                }
             }
         }
     }