diff --git a/plugins/TwitterBridge/twitter.php b/plugins/TwitterBridge/twitter.php index 33dfb788bf..6944a1ace0 100644 --- a/plugins/TwitterBridge/twitter.php +++ b/plugins/TwitterBridge/twitter.php @@ -1,7 +1,7 @@ content); // Convert !groups to #hashes + + // XXX: Make this an optional setting? + $statustxt = preg_replace('/(^|\s)!([A-Za-z0-9]{1,64})/', "\\1#\\2", $statustxt); + if (mb_strlen($statustxt) > 140) { + $noticeUrl = common_shorten_url($notice->uri); + $urlLen = mb_strlen($noticeUrl); + $statustxt = mb_substr($statustxt, 0, 140 - ($urlLen + 3)) . ' … ' . $noticeUrl; + } + return $statustxt; }