We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 86329741 authored by Brion Vibber's avatar Brion Vibber

Followup fix for ticket 1672: Twitter bridge !group->#hash conversion will now...

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)
parent c9d64c34
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment