summaryrefslogtreecommitdiff
path: root/lib/twitter.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-02-26 13:36:38 -0800
committerEvan Prodromou <evan@controlyourself.ca>2009-02-26 13:36:38 -0800
commit2674d40b62934a579c083f4f4f7f1173d64d777b (patch)
tree34c7ea2cf0e39459e90c21fddb486ac57bb67e54 /lib/twitter.php
parentee92d0b0a8870143ee462b5833b0adf47673a613 (diff)
fix notice with twitter broadcast
Diffstat (limited to 'lib/twitter.php')
-rw-r--r--lib/twitter.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/twitter.php b/lib/twitter.php
index deb6fd276..8a54afb9c 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 (!empty($flink) && ($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) ||
@@ -218,7 +218,7 @@ function is_twitter_bound($notice, $flink) {
return true;
}
}
-
+
return false;
}
@@ -227,10 +227,10 @@ function broadcast_twitter($notice)
global $config;
$success = true;
- $flink = Foreign_link::getByUserID($notice->profile_id,
+ $flink = Foreign_link::getByUserID($notice->profile_id,
TWITTER_SERVICE);
-
- // XXX: Not sure WHERE to check whether a notice should go to
+
+ // 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)) {
@@ -245,7 +245,7 @@ function broadcast_twitter($notice)
$options = array(
CURLOPT_USERPWD => "$twitter_user:$twitter_password",
CURLOPT_POST => true,
- CURLOPT_POSTFIELDS =>
+ CURLOPT_POSTFIELDS =>
array(
'status' => $statustxt,
'source' => $config['integration']['source']
@@ -293,7 +293,7 @@ function broadcast_twitter($notice)
$success = false;
}
}
-
+
return $success;
}