]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/twitter.php
Merge branch '0.7.x' into 0.8.x
[quix0rs-gnu-social.git] / lib / twitter.php
index 8a54afb9c40730c836a96a1cbaad5fc1578b912a..db2092210bd6520e8a88255616b7cece305671e0 100644 (file)
@@ -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,