summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2009-08-30 18:35:44 -0300
committerCraig Andrews <candrews@integralblue.com>2009-09-01 18:01:09 -0400
commit4c812bf8a983f18da99b558d7159ccb58e27422e (patch)
treef6fe5eec3015622ee89f4b054c4042e50c5f0e4f
parentb54a25c8951e48b675bc314d9d18d14b1957f56e (diff)
Convert !group tags to #hash tags when bridging outgoing notices to Twitter
http://status.net/trac/ticket/1672
-rw-r--r--lib/twitter.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/twitter.php b/lib/twitter.php
index 7546ffa98..4fff58fd2 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);