]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Contact/Revoke.php
Merge pull request #11528 from annando/logruntime
[friendica.git] / src / Module / Contact / Revoke.php
index 4c3a6dade58abcdd8836c2a9eb0e0ebf8ec078d2..35cb48149543686a6d1a046ee2926009fea18d66 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
- * @license   GNU AGPL version 3 or any later version
+ * @license GNU AGPL version 3 or any later version
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -38,7 +38,10 @@ use Psr\Log\LoggerInterface;
 
 class Revoke extends BaseModule
 {
-       /** @var array */
+       /**
+        * User-specific contact (uid != 0) array
+        * @var array
+        */
        protected $contact;
        
        /** @var Database */
@@ -74,7 +77,7 @@ class Revoke extends BaseModule
                }
        }
 
-       protected function post(array $request = [], array $post = [])
+       protected function post(array $request = [])
        {
                if (!local_user()) {
                        throw new HTTPException\UnauthorizedException();
@@ -82,14 +85,9 @@ class Revoke extends BaseModule
 
                self::checkFormSecurityTokenRedirectOnError('contact/' . $this->parameters['id'], 'contact_revoke');
 
-               $result = Model\Contact::revokeFollow($this->contact);
-               if ($result === true) {
-                       notice($this->t('Follow was successfully revoked.'));
-               } elseif ($result === null) {
-                       notice($this->t('Follow was successfully revoked, however the remote contact won\'t be aware of this revokation.'));
-               } else {
-                       notice($this->t('Unable to revoke follow, please try again later or contact the administrator.'));
-               }
+               Model\Contact::revokeFollow($this->contact);
+
+               notice($this->t('Follow was successfully revoked.'));
 
                $this->baseUrl->redirect('contact/' . $this->parameters['id']);
        }