X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Ftwitter.php;h=7abb40151686eb3779d689ba6bff9aa60f88ebed;hb=a13bfa5848705d23353783f195b67c088a72a8cb;hp=deb6fd276b6ac71de7fe10280ad33f129c3cd717;hpb=eaac9350dd0ff02dda975f48e0be0c6ad1e7a56d;p=quix0rs-gnu-social.git diff --git a/lib/twitter.php b/lib/twitter.php index deb6fd276b..7abb401516 100644 --- a/lib/twitter.php +++ b/lib/twitter.php @@ -210,7 +210,7 @@ function save_twitter_friends($user, $twitter_id, $screen_name, $password) function is_twitter_bound($notice, $flink) { // Check to see if notice should go to Twitter - if (($flink->noticesync & FOREIGN_NOTICE_SEND)) { + if ($flink->noticesync & FOREIGN_NOTICE_SEND) { // If it's not a Twitter-style reply, or if the user WANTS to send replies. if (!preg_match('/^@[a-zA-Z0-9_]{1,15}\b/u', $notice->content) || @@ -224,7 +224,6 @@ function is_twitter_bound($notice, $flink) { function broadcast_twitter($notice) { - global $config; $success = true; $flink = Foreign_link::getByUserID($notice->profile_id, @@ -232,7 +231,7 @@ function broadcast_twitter($notice) // XXX: Not sure WHERE to check whether a notice should go to // Twitter. Should we even put in the queue if it shouldn't? --Zach - if (is_twitter_bound($notice, $flink)) { + if (!is_null($flink) && is_twitter_bound($notice, $flink)) { $fuser = $flink->getForeignUser(); $twitter_user = $fuser->nickname; @@ -248,7 +247,7 @@ function broadcast_twitter($notice) CURLOPT_POSTFIELDS => array( 'status' => $statustxt, - 'source' => $config['integration']['source'] + 'source' => common_config('integration', 'source') ), CURLOPT_RETURNTRANSFER => true, CURLOPT_FAILONERROR => true,