]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apidirectmessagenew.php
newmessage (and Message class) fixed for FormAction
[quix0rs-gnu-social.git] / actions / apidirectmessagenew.php
index b335a9c93ee360903538f390f268ceffd648f70f..d642252b4dc1864eb8052458b4999b0b344474e7 100644 (file)
@@ -119,7 +119,7 @@ class ApiDirectMessageNewAction extends ApiAuthAction
                 $this->format
             );
         } else {
-            $content_shortened = common_shorten_links($this->content);
+            $content_shortened = $this->auth_user->shortenLinks($this->content);
             if (Message::contentTooLong($content_shortened)) {
                 $this->clientError(
                     // TRANS: Client error displayed when message content is too long.
@@ -141,7 +141,7 @@ class ApiDirectMessageNewAction extends ApiAuthAction
         } else if (!$this->user->mutuallySubscribed($this->other)) {
             $this->clientError(
                 // TRANS: Client error displayed trying to direct message another user who's not a friend (403).
-                _('Can\'t send direct messages to users who aren\'t your friend.'),
+                _('Cannot send direct messages to users who aren\'t your friend.'),
                 403,
                 $this->format
             );
@@ -163,11 +163,6 @@ class ApiDirectMessageNewAction extends ApiAuthAction
             $this->source
         );
 
-        if (is_string($message)) {
-            $this->serverError($message);
-            return;
-        }
-
         $message->notify();
 
         if ($this->format == 'xml') {