summaryrefslogtreecommitdiff
path: root/plugins/TwitterBridge/twitter.php
diff options
context:
space:
mode:
authorIan Denhardt <ian@zenhack.net>2010-08-02 11:10:19 -0400
committerIan Denhardt <ian@zenhack.net>2010-08-02 11:10:19 -0400
commit762731d8ee2ff2b8a8aa0c6f92335dd802baf536 (patch)
tree40350e1610ce3a1c973a39800b1598833081f261 /plugins/TwitterBridge/twitter.php
parenta31d977b4323850a932770774c3bb4d321096867 (diff)
parent0faa988e91056564b2ae19f045a81b322cce4e0c (diff)
Merge branch 'master' of git://gitorious.org/statusnet/mainline
Diffstat (limited to 'plugins/TwitterBridge/twitter.php')
-rw-r--r--plugins/TwitterBridge/twitter.php21
1 files changed, 19 insertions, 2 deletions
diff --git a/plugins/TwitterBridge/twitter.php b/plugins/TwitterBridge/twitter.php
index 896eee2da..306ba2442 100644
--- a/plugins/TwitterBridge/twitter.php
+++ b/plugins/TwitterBridge/twitter.php
@@ -75,8 +75,6 @@ function save_twitter_user($twitter_id, $screen_name)
if (!empty($fuser)) {
- $result = true;
-
// Delete old record if Twitter user changed screen name
if ($fuser->nickname != $screen_name) {
@@ -88,6 +86,25 @@ function save_twitter_user($twitter_id, $screen_name)
$screen_name,
$oldname));
}
+
+ } else {
+
+ // Kill any old, invalid records for this screen name
+
+ $fuser = Foreign_user::getByNickname($screen_name, TWITTER_SERVICE);
+
+ if (!empty($fuser)) {
+ $fuser->delete();
+ common_log(
+ LOG_INFO,
+ sprintf(
+ 'Twitter bridge - deteted old record for Twitter ' .
+ 'screen name "%s" belonging to Twitter ID %d.',
+ $screen_name,
+ $fuser->id
+ )
+ );
+ }
}
return add_twitter_user($twitter_id, $screen_name);