Fix for ticket #3039: TwitterBridge was incorrectly sending repeats of Twitter-bound messages if the repeater has sending of things to Twitter disabled.

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.
This commit is contained in:
Brion Vibber 2011-02-10 10:53:24 -08:00
parent 857e35c175
commit 2bf8a68908

View File

@ -173,6 +173,7 @@ function broadcast_twitter($notice)
// Don't bother with basic auth, since it's no longer allowed
if (!empty($flink) && TwitterOAuthClient::isPackedToken($flink->credentials)) {
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)) {
@ -183,10 +184,11 @@ function broadcast_twitter($notice)
// this or can discard safely.
return $retweet;
}
} else if (is_twitter_bound($notice, $flink)) {
} else {
return broadcast_oauth($notice, $flink);
}
}
}
return true;
}