]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Twitter bridge - fix for Ticket #2192
authorZach Copley <zach@status.net>
Wed, 17 Feb 2010 20:53:16 +0000 (20:53 +0000)
committerZach Copley <zach@status.net>
Wed, 17 Feb 2010 20:56:18 +0000 (20:56 +0000)
plugins/TwitterBridge/twitter.php
plugins/TwitterBridge/twitterauthorization.php

index 2dd815d3ce821eaddf08eb417debab0819b8037f..13e499d65eda5bba9e45c272e76555698706f91b 100644 (file)
@@ -33,11 +33,15 @@ function add_twitter_user($twitter_id, $screen_name)
     // repoed, and things like that.
 
     $luser = Foreign_user::getForeignUser($twitter_id, TWITTER_SERVICE);
-    $result = $luser->delete();
 
-    if ($result != false) {
-        common_log(LOG_INFO,
-            "Twitter bridge - removed old Twitter user: $screen_name ($twitter_id).");
+    if (!empty($luser)) {
+        $result = $luser->delete();
+        if ($result != false) {
+            common_log(
+                LOG_INFO,
+                "Twitter bridge - removed old Twitter user: $screen_name ($twitter_id)."
+            );
+        }
     }
 
     $fuser = new Foreign_user();
index 8bfdacee919e2bf4bba29f7a92c795237de71530..cabf69d7a8b47a0e03dc0fad1cf2eb3c877a5ca9 100644 (file)
@@ -178,7 +178,7 @@ class TwitterauthorizationAction extends Action
             );
             common_log(LOG_INFO, 'Twitter bridge - ' . $msg);
             $this->serverError(
-                _m('Couldn\'t link your Twitter account: ') . $e->getMessage()
+                _m('Couldn\'t link your Twitter account.')
             );
         }
 
@@ -226,7 +226,7 @@ class TwitterauthorizationAction extends Action
             );
             common_log(LOG_INFO, 'Twitter bridge - ' . $msg);
             $this->serverError(
-                _m('Couldn\'t link your Twitter account: ') . $e-getMessage()
+                _m('Couldn\'t link your Twitter account.')
             );
         }
 
@@ -292,7 +292,7 @@ class TwitterauthorizationAction extends Action
 
         if (empty($flink_id)) {
             common_log_db_error($flink, 'INSERT', __FILE__);
-                $this->serverError(_('Couldn\'t link your Twitter account.'));
+            $this->serverError(_('Couldn\'t link your Twitter account.'));
         }
 
         return $flink_id;