summaryrefslogtreecommitdiff
path: root/lib/twitter.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/twitter.php')
-rw-r--r--lib/twitter.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/twitter.php b/lib/twitter.php
index 676c9b20a..b49e2e119 100644
--- a/lib/twitter.php
+++ b/lib/twitter.php
@@ -165,9 +165,10 @@ 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;
@@ -222,6 +223,10 @@ function broadcast_basicauth($notice, $flink)
$user->nickname, $user->id);
common_log(LOG_WARNING, $errmsg);
+ $errmsg = sprintf('No data returned by Twitter API when ' .
+ 'trying to send update for %1$s (user id %2$s).',
+ $user->nickname, $user->id);
+ common_log(LOG_WARNING, $errmsg);
return false;
}