]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/repeat.php
Twitter Import + avatar fixes (cleaning up + fixing)
[quix0rs-gnu-social.git] / actions / repeat.php
index 4201a4ce955af96b69340d5e1e2e56e801979e59..baa35f535e480e227322436f23224c7b7cd38bde 100644 (file)
@@ -65,7 +65,7 @@ class RepeatAction extends Action
             return false;
         }
 
-        $this->notice = Notice::staticGet('id', $id);
+        $this->notice = Notice::getKV('id', $id);
 
         if (empty($this->notice)) {
             // TRANS: Client error displayed when trying to repeat a non-existing notice.
@@ -73,42 +73,14 @@ class RepeatAction extends Action
             return false;
         }
 
-        // Is it OK to repeat that notice (general enough scope)?
-
-        if ($this->notice->scope != Notice::SITE_SCOPE &&
-            $this->notice->scope != Notice::PUBLIC_SCOPE) {
-            $this->clientError(_('You may not repeat a private notice.'),
-                               403);
-        }
-
-        if ($this->user->id == $this->notice->profile_id) {
-            // TRANS: Client error displayed when trying to repeat an own notice.
-            $this->clientError(_('You cannot repeat your own notice.'));
-            return false;
-        }
-
         $token  = $this->trimmed('token-'.$id);
 
         if (empty($token) || $token != common_session_token()) {
+            // TRANS: Client error displayed when the session token does not match or is not given.
             $this->clientError(_('There was a problem with your session token. Try again, please.'));
             return false;
         }
 
-        $profile = $this->user->getProfile();
-
-        // Can the profile actually see that notice?
-
-        if (!$this->notice->inScope($profile)) {
-            $this->clientError(_('No access to that notice.'), 403);
-        }
-
-
-        if ($profile->hasRepeated($id)) {
-            // TRANS: Client error displayed when trying to repeat an already repeated notice.
-            $this->clientError(_('You already repeated that notice.'));
-            return false;
-        }
-
         return true;
     }
 
@@ -135,7 +107,7 @@ class RepeatAction extends Action
                                 // TRANS: Confirmation text after repeating a notice.
                                 _('Repeated!'));
             $this->elementEnd('body');
-            $this->elementEnd('html');
+            $this->endHTML();
         } else {
             // @todo FIXME!
         }