]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/subscribe.php
Merge branch 'at-mention-url' into 'master'
[quix0rs-gnu-social.git] / actions / subscribe.php
index 36f9fc724b53a1c552e02b7075a849a44591d640..320409afa07460d36c94d427c4ee8bc014667375 100644 (file)
@@ -74,7 +74,6 @@ class SubscribeAction extends Action
             // TRANS: Client error displayed trying to perform any request method other than POST.
             // TRANS: Do not translate POST.
             $this->clientError(_('This action only accepts POST requests.'));
-            return false;
         }
 
         // CSRF protection
@@ -85,7 +84,6 @@ class SubscribeAction extends Action
             // TRANS: Client error displayed when the session token is not okay.
             $this->clientError(_('There was a problem with your session token.'.
                                  ' Try again, please.'));
-            return false;
         }
 
         // Only for logged-in users
@@ -95,7 +93,6 @@ class SubscribeAction extends Action
         if (empty($this->user)) {
             // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
             $this->clientError(_('Not logged in.'));
-            return false;
         }
 
         // Profile to subscribe to
@@ -107,7 +104,6 @@ class SubscribeAction extends Action
         if (empty($this->other)) {
             // TRANS: Client error displayed trying to subscribe to a non-existing profile.
             $this->clientError(_('No such profile.'));
-            return false;
         }
 
         return true;
@@ -126,7 +122,7 @@ class SubscribeAction extends Action
     {
         // Throws exception on error
 
-        $sub = Subscription::start($this->user->getProfile(),
+        $sub = Subscription::ensureStart($this->user->getProfile(),
                                    $this->other);
 
         if ($this->boolean('ajax')) {