]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/twitapidirect_messages.php
maildaemon correctly checks max notice length
[quix0rs-gnu-social.git] / actions / twitapidirect_messages.php
index 85c788d6a6b941156121ff348bde3179b8ec7201..aac7d63b13fc7ce656b28ae7c94a4c2275b3dabc 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -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;
             }
         }