From: Evan Prodromou Date: Thu, 12 Mar 2009 15:56:23 +0000 (-0400) Subject: Merge branch '0.7.x' into 0.8.x X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b3a0eea3b66e95becb6c4595ed71c7fe71ed6437;p=quix0rs-gnu-social.git Merge branch '0.7.x' into 0.8.x Conflicts: classes/Notice.php lib/action.php lib/router.php lib/twitter.php --- b3a0eea3b66e95becb6c4595ed71c7fe71ed6437 diff --cc classes/Notice.php index 9b5194a5c8,3087e39a78..adeed2796b --- a/classes/Notice.php +++ b/classes/Notice.php @@@ -156,20 -162,13 +163,21 @@@ class Notice extends Memcached_DataObje $notice->query('BEGIN'); - $notice->created = common_sql_now(); - $notice->content = common_shorten_links($content); - $notice->rendered = common_render_content($notice->content, $notice); - $notice->source = $source; - $notice->uri = $uri; + $notice->reply_to = $reply_to; + $notice->created = common_sql_now(); + $notice->content = $final; + $notice->rendered = common_render_content($final, $notice); + $notice->source = $source; + $notice->uri = $uri; + if (!empty($reply_to)) { + $reply_notice = Notice::staticGet('id', $reply_to); + if (!empty($reply_notice)) { + $notice->reply_to = $reply_to; + $notice->conversation = $reply_notice->conversation; + } + } + if (Event::handle('StartNoticeSave', array(&$notice))) { $id = $notice->insert(); diff --cc lib/twitter.php index 8a54afb9c4,7abb401516..db2092210b --- a/lib/twitter.php +++ b/lib/twitter.php @@@ -224,15 -224,14 +224,14 @@@ function is_twitter_bound($notice, $fli 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)) { + if (!is_null($flink) && is_twitter_bound($notice, $flink)) { $fuser = $flink->getForeignUser(); $twitter_user = $fuser->nickname; @@@ -245,10 -244,10 +244,10 @@@ $options = array( CURLOPT_USERPWD => "$twitter_user:$twitter_password", CURLOPT_POST => true, - CURLOPT_POSTFIELDS => + CURLOPT_POSTFIELDS => array( 'status' => $statustxt, - 'source' => $config['integration']['source'] + 'source' => common_config('integration', 'source') ), CURLOPT_RETURNTRANSFER => true, CURLOPT_FAILONERROR => true,