diff options
author | Brion Vibber <brion@pobox.com> | 2009-12-18 09:36:30 -0500 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2009-12-18 09:38:25 -0500 |
commit | 2fb76eec62fee8cabda69bb3df2b5a6c988f9e8a (patch) | |
tree | 16aa2c2f4b99157b05d0d18e3a8ff17c70601a69 | |
parent | dd96558b6660c2c8cd41ff0dd3e13c6baa6e2e8a (diff) |
Followup fix for ticket 1672: Twitter bridge !group->#hash conversion will now happen regardless of whether account was configured with oauth or basic auth (previously applied only on the oauth path)
-rw-r--r-- | plugins/TwitterBridge/twitter.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/TwitterBridge/twitter.php b/plugins/TwitterBridge/twitter.php index fd5150638..2b9cde1aa 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; @@ -276,7 +274,12 @@ function process_error($e, $flink) 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) |