summaryrefslogtreecommitdiff
path: root/plugins/TwitterBridge
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-02-15 22:13:10 +0000
committerZach Copley <zach@status.net>2010-02-15 22:14:54 +0000
commit0ba375917129eaee2608203ed532efb3b9db879c (patch)
tree452672d2467f629d667e43a653d8cb6e913fb2d1 /plugins/TwitterBridge
parent66f427c373b6559aa81f4b3b18b0aa58ec689c0d (diff)
Use static class method for looking up Twitter user
Diffstat (limited to 'plugins/TwitterBridge')
-rw-r--r--plugins/TwitterBridge/twitter.php11
1 files changed, 1 insertions, 10 deletions
diff --git a/plugins/TwitterBridge/twitter.php b/plugins/TwitterBridge/twitter.php
index ce989768e..e5afde62c 100644
--- a/plugins/TwitterBridge/twitter.php
+++ b/plugins/TwitterBridge/twitter.php
@@ -28,15 +28,11 @@ require_once INSTALLDIR . '/plugins/TwitterBridge/twitteroauthclient.php';
function add_twitter_user($twitter_id, $screen_name)
{
- $new_uri = 'http://twitter.com/' . $screen_name;
-
// Clear out any bad old foreign_users with the new user's legit URL
// This can happen when users move around or fakester accounts get
// repoed, and things like that.
- $luser = new Foreign_user();
- $luser->id = $twitter_id;
- $luser->service = TWITTER_SERVICE;
+ $luser = Foreign_user::getForeignUser($twitter_id, TWITTER_SERVICE);
$result = $luser->delete();
if ($result != false) {
@@ -44,11 +40,6 @@ function add_twitter_user($twitter_id, $screen_name)
"Twitter bridge - removed old Twitter user: $screen_name ($twitter_id).");
}
- $luser->free();
- unset($luser);
-
- // Otherwise, create a new Twitter user
-
$fuser = new Foreign_user();
$fuser->nickname = $screen_name;