From: Hannes Mannerheim Date: Mon, 20 Oct 2014 14:20:12 +0000 (+0200) Subject: repeat-bug, could not repeat oversized notices X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a3b66da261caaaf68e609a7d5adfde5aef531992;p=quix0rs-gnu-social.git repeat-bug, could not repeat oversized notices this code is copy-paste from statusnet, apparently we need it still --- diff --git a/classes/Notice.php b/classes/Notice.php index b6f480ed5e..f2a746a844 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -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,