]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apidirectmessage.php
Fix for API group methods, caused failure or output corruption when pulling up local...
[quix0rs-gnu-social.git] / actions / apidirectmessage.php
index 4e55886d95bb0240473ce3ecca3d992823338594..53da9e0c68a297195c74c6b33eee1c8a5648539a 100644 (file)
@@ -21,6 +21,9 @@
  *
  * @category  API
  * @package   StatusNet
+ * @author    Adrian Lang <mail@adrianlang.de>
+ * @author    Evan Prodromou <evan@status.net>
+ * @author    Robin Millette <robin@millette.info>
  * @author    Zach Copley <zach@status.net>
  * @copyright 2009 StatusNet, Inc.
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
@@ -31,13 +34,16 @@ if (!defined('STATUSNET')) {
     exit(1);
 }
 
-require_once INSTALLDIR.'/lib/apiauth.php';
+require_once INSTALLDIR . '/lib/apiauth.php';
 
 /**
  * Show a list of direct messages from or to the authenticating user
  *
  * @category API
  * @package  StatusNet
+ * @author   Adrian Lang <mail@adrianlang.de>
+ * @author   Evan Prodromou <evan@status.net>
+ * @author   Robin Millette <robin@millette.info>
  * @author   Zach Copley <zach@status.net>
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link     http://status.net/
@@ -68,12 +74,12 @@ class ApiDirectMessageAction extends ApiAuthAction
         $this->user = $this->auth_user;
 
         if (empty($this->user)) {
-            $this->clientError(_('No such user!'), 404, $this->format);
+            $this->clientError(_('No such user.'), 404, $this->format);
             return;
         }
 
         $server   = common_root_url();
-        $taguribase = common_config('integration', 'taguri');
+        $taguribase = TagURI::base();
 
         if ($this->arg('sent')) {
 
@@ -147,7 +153,7 @@ class ApiDirectMessageAction extends ApiAuthAction
             $this->showJsonDirectMessages();
             break;
         default:
-            $this->clientError(_('API method not found!'), $code = 404);
+            $this->clientError(_('API method not found.'), $code = 404);
             break;
         }
     }
@@ -176,11 +182,6 @@ class ApiDirectMessageAction extends ApiAuthAction
             $message->whereAdd('id > ' . $this->since_id);
         }
 
-        if (!empty($since)) {
-            $d = date('Y-m-d H:i:s', $this->since);
-            $message->whereAdd("created > '$d'");
-        }
-
         $message->orderBy('created DESC, id DESC');
         $message->limit((($this->page - 1) * $this->count), $this->count);
         $message->find();