]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/subscribe.php
work in progress...
[quix0rs-gnu-social.git] / actions / subscribe.php
index 3837915d538cd1e09ab237245dfd0689d2af1c0e..fad153fc6e39f1f0110775527eabdce15717f970 100644 (file)
@@ -139,8 +139,8 @@ class SubscribeAction extends Action
     {
         // Throws exception on error
 
-        Subscription::start($this->user->getProfile(),
-                            $this->other);
+        $sub = Subscription::start($this->user->getProfile(),
+                                   $this->other);
 
         if ($this->boolean('ajax')) {
             $this->startHTML('text/xml;charset=utf-8');
@@ -149,8 +149,12 @@ class SubscribeAction extends Action
             $this->element('title', null, _('Subscribed'));
             $this->elementEnd('head');
             $this->elementStart('body');
-            $unsubscribe = new UnsubscribeForm($this, $this->other);
-            $unsubscribe->show();
+            if ($sub instanceof Subscription) {
+                $form = new UnsubscribeForm($this, $this->other);
+            } else {
+                $form = new CancelSubscriptionForm($this, $this->other);
+            }
+            $form->show();
             $this->elementEnd('body');
             $this->elementEnd('html');
         } else {