X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fsubscribe.php;h=ce1d367cf894fe01a009a23dfe62d82423cecb5a;hb=f79aec36feaa4760201a7e88d5b31513a3c458ba;hp=3837915d538cd1e09ab237245dfd0689d2af1c0e;hpb=325cb4833db7e3fd396720f12a27b880b63f4173;p=quix0rs-gnu-social.git diff --git a/actions/subscribe.php b/actions/subscribe.php index 3837915d53..ce1d367cf8 100644 --- a/actions/subscribe.php +++ b/actions/subscribe.php @@ -1,7 +1,7 @@ user = common_current_user(); if (empty($this->user)) { - // TRANS: Client error displayed trying to subscribe when not logged in. + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_('Not logged in.')); return false; } @@ -111,18 +111,6 @@ class SubscribeAction extends Action return false; } - // OMB 0.1 doesn't have a mechanism for local-server- - // originated subscription. - - $omb01 = Remote_profile::staticGet('id', $other_id); - - if (!empty($omb01)) { - // TRANS: Client error displayed trying to subscribe to an OMB 0.1 remote profile. - $this->clientError(_('You cannot subscribe to an OMB 0.1'. - ' remote profile with this action.')); - return false; - } - return true; } @@ -139,8 +127,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 +137,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 {