repeat-bug, could not repeat oversized notices

this code is copy-paste from statusnet, apparently we need it still
This commit is contained in:
Hannes Mannerheim 2014-10-20 16:20:12 +02:00
parent e3bb5e1df9
commit a3b66da261
1 changed files with 12 additions and 0 deletions

View File

@ -2101,6 +2101,18 @@ class Notice extends Managed_DataObject
$author->getNickname(),
$this->content);
$maxlen = self::maxContent();
if ($maxlen > 0 && mb_strlen($content) > $maxlen) {
// Web interface and current Twitter API clients will
// pull the original notice's text, but some older
// clients and RSS/Atom feeds will see this trimmed text.
//
// Unfortunately this is likely to lose tags or URLs
// at the end of long notices.
$content = mb_substr($content, 0, $maxlen - 4) . ' ...';
}
// Scope is same as this one's
return self::saveNew($repeater->id,
$content,