]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apidirectmessage.php
Email notify-on-fave moved to Profile_prefs (run upgrade.php)
[quix0rs-gnu-social.git] / actions / apidirectmessage.php
index 4e2ec5eb08d88286fde2078788fb6f6f9e7c3833..e971a7d4eed9953434481dc2f324aa8def2694d1 100644 (file)
@@ -34,8 +34,6 @@ if (!defined('STATUSNET')) {
     exit(1);
 }
 
-require_once INSTALLDIR . '/lib/apiauth.php';
-
 /**
  * Show a list of direct messages from or to the authenticating user
  *
@@ -48,7 +46,6 @@ require_once INSTALLDIR . '/lib/apiauth.php';
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link     http://status.net/
  */
-
 class ApiDirectMessageAction extends ApiAuthAction
 {
     var $messages     = null;
@@ -64,9 +61,7 @@ class ApiDirectMessageAction extends ApiAuthAction
      * @param array $args $_REQUEST args
      *
      * @return boolean success flag
-     *
      */
-
     function prepare($args)
     {
         parent::prepare($args);
@@ -75,8 +70,7 @@ class ApiDirectMessageAction extends ApiAuthAction
 
         if (empty($this->user)) {
             // TRANS: Client error given when a user was not found (404).
-            $this->clientError(_('No such user.'), 404, $this->format);
-            return;
+            $this->clientError(_('No such user.'), 404);
         }
 
         $server   = common_root_url();
@@ -87,12 +81,12 @@ class ApiDirectMessageAction extends ApiAuthAction
             // Action was called by /api/direct_messages/sent.format
 
             $this->title = sprintf(
-                // TRANS: %s is a user nickname.
+                // TRANS: Title. %s is a user nickname.
                 _("Direct messages from %s"),
                 $this->user->nickname
             );
             $this->subtitle = sprintf(
-                // TRANS: %s is a user nickname.
+                // TRANS: Subtitle. %s is a user nickname.
                 _("All the direct messages sent from %s"),
                 $this->user->nickname
             );
@@ -101,12 +95,12 @@ class ApiDirectMessageAction extends ApiAuthAction
             $this->id = "tag:$taguribase:SentDirectMessages:" . $this->user->id;
         } else {
             $this->title = sprintf(
-                // TRANS: %s is a user nickname.
+                // TRANS: Title. %s is a user nickname.
                 _("Direct messages to %s"),
                 $this->user->nickname
             );
             $this->subtitle = sprintf(
-                // TRANS: %s is a user nickname.
+                // TRANS: Subtitle. %s is a user nickname.
                 _("All the direct messages sent to %s"),
                 $this->user->nickname
             );
@@ -129,7 +123,6 @@ class ApiDirectMessageAction extends ApiAuthAction
      *
      * @return void
      */
-
     function handle($args)
     {
         parent::handle($args);
@@ -141,7 +134,6 @@ class ApiDirectMessageAction extends ApiAuthAction
      *
      * @return void
      */
-
     function showMessages()
     {
         switch($this->format) {
@@ -158,7 +150,7 @@ class ApiDirectMessageAction extends ApiAuthAction
             $this->showJsonDirectMessages();
             break;
         default:
-            // TRANS: Client error given when an API method was not found (404).
+            // TRANS: Client error displayed when coming across a non-supported API method.
             $this->clientError(_('API method not found.'), $code = 404);
             break;
         }
@@ -169,7 +161,6 @@ class ApiDirectMessageAction extends ApiAuthAction
      *
      * @return array notices
      */
-
     function getMessages()
     {
         $message  = new Message();
@@ -208,7 +199,6 @@ class ApiDirectMessageAction extends ApiAuthAction
      *
      * @return boolean true
      */
-
     function isReadOnly($args)
     {
         return true;
@@ -219,7 +209,6 @@ class ApiDirectMessageAction extends ApiAuthAction
      *
      * @return string datestamp of the latest notice in the stream
      */
-
     function lastModified()
     {
         if (!empty($this->messages)) {
@@ -234,7 +223,6 @@ class ApiDirectMessageAction extends ApiAuthAction
      *
      * @return void
      */
-
     function showXmlDirectMessages()
     {
         $this->initDocument('xml');
@@ -255,7 +243,6 @@ class ApiDirectMessageAction extends ApiAuthAction
      *
      * @return void
      */
-
     function showJsonDirectMessages()
     {
         $this->initDocument('json');
@@ -276,7 +263,6 @@ class ApiDirectMessageAction extends ApiAuthAction
      *
      * @return void
      */
-
     function showRssDirectMessages()
     {
         $this->initDocument('rss');
@@ -311,7 +297,6 @@ class ApiDirectMessageAction extends ApiAuthAction
      *
      * @return void
      */
-
     function showAtomDirectMessages()
     {
         $this->initDocument('atom');
@@ -353,7 +338,6 @@ class ApiDirectMessageAction extends ApiAuthAction
      *
      * @return string etag
      */
-
     function etag()
     {
         if (!empty($this->messages)) {
@@ -374,5 +358,4 @@ class ApiDirectMessageAction extends ApiAuthAction
 
         return null;
     }
-
 }