]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
API for direct messages correctly checks length
authorEvan Prodromou <evan@controlyourself.ca>
Fri, 21 Aug 2009 11:32:08 +0000 (07:32 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Fri, 21 Aug 2009 11:32:08 +0000 (07:32 -0400)
actions/twitapidirect_messages.php

index bd27e9d20abb25976bc8c7e74b6a578bc9fc1ae8..aac7d63b13fc7ce656b28ae7c94a4c2275b3dabc 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;
             }
         }