diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-08-21 08:19:09 -0400 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-08-21 08:19:09 -0400 |
commit | a94a5fb51ae37ccf99218a236c5a1c3c68c7fffa (patch) | |
tree | cbb98de36381d0692f80871d44bbf3b1b8c127cf /scripts/xmppdaemon.php | |
parent | 35bf388204ab978e09a036aaa4e301b208f0a4ed (diff) |
correctly check for max notice length in xmppdaemon
Diffstat (limited to 'scripts/xmppdaemon.php')
-rwxr-xr-x | scripts/xmppdaemon.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/xmppdaemon.php b/scripts/xmppdaemon.php index 69512f243..f033025f8 100755 --- a/scripts/xmppdaemon.php +++ b/scripts/xmppdaemon.php @@ -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'); |