summaryrefslogtreecommitdiff
path: root/plugins/TwitterBridge/twitter.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-03-05 02:27:01 +0000
committerZach Copley <zach@status.net>2010-03-05 03:55:39 +0000
commit6aac7cc6cd011b3c86f3f4c8e00a14f992a78306 (patch)
tree6dcc1f2a85658341ccef0a199a4e1032c003b19a /plugins/TwitterBridge/twitter.php
parent5e60bf2ca65f5e862fa1741e42d35e2ae7bb5559 (diff)
Fix for errant deletion of all Twitter foreign_links
Diffstat (limited to 'plugins/TwitterBridge/twitter.php')
-rw-r--r--plugins/TwitterBridge/twitter.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/TwitterBridge/twitter.php b/plugins/TwitterBridge/twitter.php
index 13e499d65..90805bfc4 100644
--- a/plugins/TwitterBridge/twitter.php
+++ b/plugins/TwitterBridge/twitter.php
@@ -273,7 +273,16 @@ function remove_twitter_link($flink)
common_log(LOG_INFO, 'Removing Twitter bridge Foreign link for ' .
"user $user->nickname (user id: $user->id).");
- $result = $flink->delete();
+ $result = false;
+
+ // Be extra careful to make sure we have a good flink
+ // before deleting
+ if (!empty($flink->user_id)
+ && !empty($flink->foreign_id)
+ && !empty($flink->service))
+ {
+ $result = $flink->delete();
+ }
if (empty($result)) {
common_log(LOG_ERR, 'Could not remove Twitter bridge ' .