]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Convert !group tags to #hash tags when bridging outgoing notices to Twitter
authorBrion Vibber <brion@pobox.com>
Sun, 30 Aug 2009 21:35:44 +0000 (18:35 -0300)
committerCraig Andrews <candrews@integralblue.com>
Tue, 1 Sep 2009 22:01:09 +0000 (18:01 -0400)
http://status.net/trac/ticket/1672

lib/twitter.php

index 7546ffa98a38e0c533929be384e5a6815516646e..4fff58fd20bc8d373f98f632b9c75ceebe1215cf 100644 (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);