]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/twitapidirect_messages.php
Merge branch '0.8.x' into 0.9.x
[quix0rs-gnu-social.git] / actions / twitapidirect_messages.php
index dbe55804b16337aada7f06f373c481e19eb96d44..08b8f4e9c18a78121cd133cbbb594f5a90a5067f 100644 (file)
@@ -141,9 +141,10 @@ class Twitapidirect_messagesAction extends TwitterapiAction
                 $code = 406, $apidata['content-type']);
         } else {
             $content_shortened = common_shorten_links($content);
-            if (mb_strlen($content_shortened) > 140) {
-                $this->clientError(_('That\'s too long. Max message size is 140 chars.'),
-                    $code = 406, $apidata['content-type']);
+            if (Message::contentTooLong($content_shortened)) {
+                $this->clientError(sprintf(_('That\'s too long. Max message size is %d chars.'),
+                                           Message::maxContent()),
+                                   $code = 406, $apidata['content-type']);
                 return;
             }
         }