diff options
author | Brion Vibber <brion@pobox.com> | 2010-07-28 11:59:42 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-07-28 11:59:42 -0700 |
commit | ab2c3686b7711f3d0e727093b487fcb54448cc39 (patch) | |
tree | b42bbd7ca1be71f3b5f72e8461096f6e3c95b2c3 /plugins/TwitterBridge | |
parent | d645b342ac4a678b9f7932ee38858e25cd611f35 (diff) | |
parent | 189d34173311828ccfe0aec5f381ad26887384ce (diff) |
Merge branch 'testing' into 0.9.x
Diffstat (limited to 'plugins/TwitterBridge')
-rw-r--r-- | plugins/TwitterBridge/twitter.php | 21 |
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); |