X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Ftwitapidirect_messages.php;h=08b8f4e9c18a78121cd133cbbb594f5a90a5067f;hb=affe00276a008038e8a8b37b3812215e382fe98e;hp=bd27e9d20abb25976bc8c7e74b6a578bc9fc1ae8;hpb=9014a0a90d9ab5ee408aded51f379fd084fcd82c;p=quix0rs-gnu-social.git diff --git a/actions/twitapidirect_messages.php b/actions/twitapidirect_messages.php index bd27e9d20a..08b8f4e9c1 100644 --- a/actions/twitapidirect_messages.php +++ b/actions/twitapidirect_messages.php @@ -1,7 +1,7 @@ . */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -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; } }