]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Subscription_queue.php
Qvitter API changes (thanks hannes2peer)
[quix0rs-gnu-social.git] / classes / Subscription_queue.php
index 3e254dfce1dcb732b97a5cbb490b1390c45d566e..ea0e906d43fca01c1208eeafc1508fc556d135ab 100644 (file)
@@ -14,14 +14,6 @@ class Subscription_queue extends Managed_DataObject
     public $subscribed;
     public $created;
 
-    /* Static get */
-    function staticGet($k,$v=null)
-    { return Memcached_DataObject::staticGet('Subscription_queue',$k,$v); }
-
-    /* Pkey get */
-    function pkeyGet($k)
-    { return Memcached_DataObject::pkeyGet('Subscription_queue',$k); }
-
     /* the code above is auto generated do not remove the tag below */
     ###END_AUTOCODE
 
@@ -70,9 +62,9 @@ class Subscription_queue extends Managed_DataObject
      */
     public function complete()
     {
-        $subscriber = Profile::staticGet('id', $this->subscriber);
-        $subscribed = Profile::staticGet('id', $this->subscribed);
-        $sub = Subscription::start($subscriber, $other, Subscription::FORCE);
+        $subscriber = Profile::getKV('id', $this->subscriber);
+        $subscribed = Profile::getKV('id', $this->subscribed);
+        $sub = Subscription::start($subscriber, $subscribed, Subscription::FORCE);
         if ($sub) {
             $this->delete();
         }
@@ -82,10 +74,10 @@ class Subscription_queue extends Managed_DataObject
     /**
      * Cancel an outstanding subscription request to the other profile.
      */
-    public function abort($profile)
+    public function abort()
     {
-        $subscriber = Profile::staticGet('id', $this->subscriber);
-        $subscribed = Profile::staticGet('id', $this->subscribed);
+        $subscriber = Profile::getKV('id', $this->subscriber);
+        $subscribed = Profile::getKV('id', $this->subscribed);
         if (Event::handle('StartCancelSubscription', array($subscriber, $subscribed))) {
             $this->delete();
             Event::handle('EndCancelSubscription', array($subscriber, $subscribed));
@@ -98,8 +90,8 @@ class Subscription_queue extends Managed_DataObject
      */
     public function notify()
     {
-        $subscriber = Profile::staticGet('id', $this->subscriber);
-        $subscribed = Profile::staticGet('id', $this->subscribed);
-        //mail_notify_subscription_pending($subscribed, $subscriber);
+        $other = Profile::getKV('id', $this->subscriber);
+        $listenee = User::getKV('id', $this->subscribed);
+        mail_subscribe_pending_notify_profile($listenee, $other);
     }
 }