summaryrefslogtreecommitdiff
path: root/plugins/TwitterBridge/twitter.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-12-22 08:53:50 -0800
committerEvan Prodromou <evan@status.net>2009-12-22 08:53:50 -0800
commita2cb0a033fa6777d824dc40e759294287bd83939 (patch)
tree96b6947fd9aa7a76c1888a127e21e34319334f9b /plugins/TwitterBridge/twitter.php
parentf17016470170401e1ad1b869c740063a578cb4cd (diff)
parentc9c316db7f003e018202e6c9f39770c208aecc05 (diff)
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'plugins/TwitterBridge/twitter.php')
-rw-r--r--plugins/TwitterBridge/twitter.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/TwitterBridge/twitter.php b/plugins/TwitterBridge/twitter.php
index 003b52682..e133ce6f7 100644
--- a/plugins/TwitterBridge/twitter.php
+++ b/plugins/TwitterBridge/twitter.php
@@ -170,8 +170,6 @@ function broadcast_twitter($notice)
function broadcast_oauth($notice, $flink) {
$user = $flink->getUser();
$statustxt = format_status($notice);
- // 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);
$status = null;
@@ -290,7 +288,12 @@ function process_error($e, $flink, $notice)
function format_status($notice)
{
// XXX: Hack to get around PHP cURL's use of @ being a a meta character
- return preg_replace('/^@/', ' @', $notice->content);
+ $statustxt = preg_replace('/^@/', ' @', $notice->content);
+
+ // Convert !groups to #hashes
+ $statustxt = preg_replace('/(^|\s)!([A-Za-z0-9]{1,64})/', "\\1#\\2", $statustxt);
+
+ return $statustxt;
}
function remove_twitter_link($flink)