]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix for ticket #3039: TwitterBridge was incorrectly sending repeats of Twitter-bound...
authorBrion Vibber <brion@pobox.com>
Thu, 10 Feb 2011 18:53:24 +0000 (10:53 -0800)
committerBrion Vibber <brion@pobox.com>
Thu, 10 Feb 2011 18:53:24 +0000 (10:53 -0800)
A repeat/retweet is roughly equivalent to an active direct post, so should follow the posting rules, rather than always sending over as we do for fave notifications.

plugins/TwitterBridge/twitter.php

index e8d11f3b6a5cc251ef79df5d0a68c7e4af316938..f5a0b62588d7428062a65bed2edf51bd098a8fbc 100644 (file)
@@ -173,18 +173,20 @@ function broadcast_twitter($notice)
 
     // Don't bother with basic auth, since it's no longer allowed
     if (!empty($flink) && TwitterOAuthClient::isPackedToken($flink->credentials)) {
-        if (!empty($notice->repeat_of) && is_twitter_notice($notice->repeat_of)) {
-            $retweet = retweet_notice($flink, Notice::staticGet('id', $notice->repeat_of));
-            if (is_object($retweet)) {
-                Notice_to_status::saveNew($notice->id, twitter_id($retweet));
-                return true;
+        if (is_twitter_bound($notice, $flink)) {
+            if (!empty($notice->repeat_of) && is_twitter_notice($notice->repeat_of)) {
+                $retweet = retweet_notice($flink, Notice::staticGet('id', $notice->repeat_of));
+                if (is_object($retweet)) {
+                    Notice_to_status::saveNew($notice->id, twitter_id($retweet));
+                    return true;
+                } else {
+                    // Our error processing will have decided if we need to requeue
+                    // this or can discard safely.
+                    return $retweet;
+                }
             } else {
-                // Our error processing will have decided if we need to requeue
-                // this or can discard safely.
-                return $retweet;
+                return broadcast_oauth($notice, $flink);
             }
-        } else if (is_twitter_bound($notice, $flink)) {
-            return broadcast_oauth($notice, $flink);
         }
     }