]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
use Subscription::start() for remote subscribes
authorEvan Prodromou <evan@status.net>
Wed, 24 Feb 2010 20:20:06 +0000 (15:20 -0500)
committerEvan Prodromou <evan@status.net>
Wed, 24 Feb 2010 20:20:06 +0000 (15:20 -0500)
plugins/OStatus/classes/Ostatus_profile.php

index 9f9efb96ee98f3e3b219258c4c8859ed3490c6fb..e8ab065224166eba00cbab13b7d83d6d9e250546 100644 (file)
@@ -299,18 +299,9 @@ class Ostatus_profile extends Memcached_DataObject
             throw new ServerException("Remote groups can't subscribe to local users");
         }
 
-        // @fixme use regular channels for subbing, once they accept remote profiles
-        $sub = new Subscription();
-        $sub->subscriber = $this->profile_id;
-        $sub->subscribed = $user->id;
-        $sub->created = common_sql_now(); // current time
-
-        if ($sub->insert()) {
-            // @fixme use subs_notify() if refactored to take profiles?
-            mail_subscribe_notify_profile($user, $this->localProfile());
-            return true;
-        }
-        return false;
+        Subscription::start($this->localProfile(), $user->getProfile());
+
+        return true;
     }
 
     /**
@@ -1127,7 +1118,6 @@ class Ostatus_profile extends Memcached_DataObject
         }
     }
 
-
     protected static function getActivityObjectNickname($object, $hints=array())
     {
         if ($object->poco) {