summaryrefslogtreecommitdiff
path: root/plugins/TwitterBridge/twitterbasicauthclient.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-07-12 14:21:57 -0700
committerBrion Vibber <brion@pobox.com>2010-07-12 14:21:57 -0700
commitcd29d3d646379aa9a1352035973c8e379cc7f42b (patch)
treee064c5292c546e6df8eaad9609a56150f69c62c3 /plugins/TwitterBridge/twitterbasicauthclient.php
parentbd8506eee883ecd424fdf3d7e545c10c754df6ff (diff)
parent1b3b7f9a422f6b703ec36d43e2283f91a9835f3b (diff)
Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'plugins/TwitterBridge/twitterbasicauthclient.php')
-rw-r--r--plugins/TwitterBridge/twitterbasicauthclient.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/plugins/TwitterBridge/twitterbasicauthclient.php b/plugins/TwitterBridge/twitterbasicauthclient.php
index fd26293f9..2c18c9469 100644
--- a/plugins/TwitterBridge/twitterbasicauthclient.php
+++ b/plugins/TwitterBridge/twitterbasicauthclient.php
@@ -76,18 +76,21 @@ class TwitterBasicAuthClient
/**
* Calls Twitter's /statuses/update API method
*
- * @param string $status text of the status
- * @param int $in_reply_to_status_id optional id of the status it's
- * a reply to
+ * @param string $status text of the status
+ * @param mixed $params optional other parameters to pass to Twitter,
+ * as defined. For back-compatibility, if an int
+ * is passed we'll consider it a reply-to ID.
*
* @return mixed the status
*/
function statusesUpdate($status, $in_reply_to_status_id = null)
{
$url = 'https://twitter.com/statuses/update.json';
- $params = array('status' => $status,
- 'source' => common_config('integration', 'source'),
- 'in_reply_to_status_id' => $in_reply_to_status_id);
+ if (is_numeric($params)) {
+ $params = array('in_reply_to_status_id' => intval($params));
+ }
+ $params['status'] = $status;
+ $params['source'] = common_config('integration', 'source');
$response = $this->httpRequest($url, $params);
$status = json_decode($response);
return $status;