diff options
author | Evan Prodromou <evan@status.net> | 2010-01-10 11:15:45 -0800 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-01-10 11:15:45 -0800 |
commit | 91760ae2ae677c68fa818e98e35525f07ded3fd8 (patch) | |
tree | a63c8cc4348405e7a74a3b51e809dfcc3def2f4b /classes | |
parent | 31585453fc7c7ed2d4b9c72ef0478e541b5622e4 (diff) | |
parent | d6db8e58170e6e78a0fd67d50f7fea5d95b5d9c8 (diff) |
Merge branch 'master' of git@gitorious.org:statusnet/mainline
Diffstat (limited to 'classes')
-rw-r--r-- | classes/Notice.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/classes/Notice.php b/classes/Notice.php index 93e94230d..c2ff7fd09 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -1366,12 +1366,21 @@ class Notice extends Memcached_DataObject { $author = Profile::staticGet('id', $this->profile_id); - // FIXME: truncate on long repeats...? - $content = sprintf(_('RT @%1$s %2$s'), $author->nickname, $this->content); + $maxlen = common_config('site', 'textlimit'); + 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) . ' ...'; + } + return self::saveNew($repeater_id, $content, $source, array('repeat_of' => $this->id)); } |