]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/nudge.php
Merge branch '0.8.x' of git@gitorious.org:+laconica-developers/laconica/dev into...
[quix0rs-gnu-social.git] / actions / nudge.php
index 456106459457f6ac4dbb3620bc006fc60c8f38d1..c23d3e64356f4af88ea166663e9d61d56cc95c09 100644 (file)
@@ -42,6 +42,7 @@ require_once INSTALLDIR.'/lib/mail.php';
  * @package  Laconica
  * @author   Evan Prodromou <evan@controlyourself.ca>
  * @author   Robin Millette <millette@controlyourself.ca>
+ * @author   Sarven Capadisli <csarven@controlyourself.ca>
  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
  * @link     http://laconi.ca/
  */
@@ -49,7 +50,7 @@ class NudgeAction extends Action
 {
      /**
      * Class handler.
-     * 
+     *
      * @param array $args array of arguments
      *
      * @return nothing
@@ -74,7 +75,7 @@ class NudgeAction extends Action
 
         // CSRF protection
         $token = $this->trimmed('token');
-        
+
         if (!$token || $token != common_session_token()) {
             $this->clientError(_('There was a problem with your session token. Try again, please.'));
             return;
@@ -88,18 +89,19 @@ class NudgeAction extends Action
         $this->notify($user, $other);
 
         if ($this->boolean('ajax')) {
-            $this->startHTML('text/xml;charset=utf-8', true);
+            $this->startHTML('text/xml;charset=utf-8');
             $this->elementStart('head');
             $this->element('title', null, _('Nudge sent'));
             $this->elementEnd('head');
             $this->elementStart('body');
-            common_nudge_response();
+            $this->element('p', array('id' => 'nudge_response'), _('Nudge sent!'));
             $this->elementEnd('body');
             $this->elementEnd('html');
         } else {
             // display a confirmation to the user
             common_redirect(common_local_url('showstream',
-                                             array('nickname' => $other->nickname)));
+                                             array('nickname' => $other->nickname)),
+                            303);
         }
     }
 
@@ -121,5 +123,10 @@ class NudgeAction extends Action
             // XXX: notify by SMS
         }
     }
+
+    function isReadOnly($args)
+    {
+        return true;
+    }
 }