]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Followup fix for ticket 1672: Twitter bridge !group->#hash conversion will now happen...
authorBrion Vibber <brion@pobox.com>
Fri, 18 Dec 2009 14:36:30 +0000 (09:36 -0500)
committerBrion Vibber <brion@pobox.com>
Fri, 18 Dec 2009 14:38:25 +0000 (09:38 -0500)
plugins/TwitterBridge/twitter.php

index fd51506388f441ef8d8e63ec889b26613fecefa0..2b9cde1aa895c832274de2bf3f84939ccae43410 100644 (file)
@@ -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)