]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
correctly check for max notice length in xmppdaemon
authorEvan Prodromou <evan@controlyourself.ca>
Fri, 21 Aug 2009 12:19:09 +0000 (08:19 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Fri, 21 Aug 2009 12:19:09 +0000 (08:19 -0400)
scripts/xmppdaemon.php

index 69512f243895e6d6d2a9c023a5408638f141e1a1..f033025f8376f6a6086e3840555feb4fcfce6f4e 100755 (executable)
@@ -316,9 +316,11 @@ class XMPPDaemon extends Daemon
     {
         $body = trim($pl['body']);
         $content_shortened = common_shorten_links($body);
-        if (mb_strlen($content_shortened) > 140) {
+        if (Notice::contentTooLong($content_shortened)) {
           $from = jabber_normalize_jid($pl['from']);
-          $this->from_site($from, "Message too long - maximum is 140 characters, you sent ".mb_strlen($content_shortened));
+          $this->from_site($from, sprintf(_("Message too long - maximum is %d characters, you sent %d"),
+                                          Notice::maxContent(),
+                                          mb_strlen($content_shortened)));
           return;
         }
         $notice = Notice::saveNew($user->id, $content_shortened, 'xmpp');