Convert !group tags to #hash tags when bridging outgoing notices to Twitter

http://status.net/trac/ticket/1672
This commit is contained in:
Brion Vibber 2009-08-30 18:35:44 -03:00 committed by Craig Andrews
parent b54a25c895
commit 4c812bf8a9

View File

@ -160,6 +160,9 @@ function broadcast_twitter($notice)
// XXX: Hack to get around PHP cURL's use of @ being a a meta character
$statustxt = preg_replace('/^@/', ' @', $notice->content);
// Convert !groups to #hashes
$statustxt = preg_replace('/(^|\s)!([A-Za-z0-9]{1,64})/', "\\1#\\2", $statustxt);
$token = TwitterOAuthClient::unpackToken($flink->credentials);
$client = new TwitterOAuthClient($token->key, $token->secret);