From: Brion Vibber Date: Sun, 30 Aug 2009 21:35:44 +0000 (-0300) Subject: Convert !group tags to #hash tags when bridging outgoing notices to Twitter X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4c812bf8a983f18da99b558d7159ccb58e27422e;p=quix0rs-gnu-social.git Convert !group tags to #hash tags when bridging outgoing notices to Twitter http://status.net/trac/ticket/1672 --- diff --git a/lib/twitter.php b/lib/twitter.php index 7546ffa98a..4fff58fd20 100644 --- a/lib/twitter.php +++ b/lib/twitter.php @@ -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);