Merge branch '0.7.x' of git@gitorious.org:+laconica-developers/laconica/dev into 0.7.x

This commit is contained in:
Evan Prodromou 2009-05-27 14:51:52 -04:00
commit f59ab5dc40
2 changed files with 13 additions and 5 deletions

View File

@ -138,9 +138,6 @@ class FacebookhomeAction extends FacebookAction
function setDefaults() function setDefaults()
{ {
// A default prefix string for notices
$this->facebook->api_client->data_setUserPreference(
FACEBOOK_NOTICE_PREFIX, 'dented: ');
$this->facebook->api_client->data_setUserPreference( $this->facebook->api_client->data_setUserPreference(
FACEBOOK_PROMPTED_UPDATE_PREF, 'false'); FACEBOOK_PROMPTED_UPDATE_PREF, 'false');
} }

View File

@ -27,9 +27,21 @@ define("FACEBOOK_PROMPTED_UPDATE_PREF", 2);
function getFacebook() function getFacebook()
{ {
static $facebook = null;
$apikey = common_config('facebook', 'apikey'); $apikey = common_config('facebook', 'apikey');
$secret = common_config('facebook', 'secret'); $secret = common_config('facebook', 'secret');
return new Facebook($apikey, $secret);
if ($facebook === null) {
$facebook = new Facebook($apikey, $secret);
}
if (!$facebook) {
common_log(LOG_ERR, 'Could not make new Facebook client obj!',
__FILE__);
}
return $facebook;
} }
function updateProfileBox($facebook, $flink, $notice) { function updateProfileBox($facebook, $flink, $notice) {
@ -92,7 +104,6 @@ function isFacebookBound($notice, $flink) {
} }
function facebookBroadcastNotice($notice) function facebookBroadcastNotice($notice)
{ {
$facebook = getFacebook(); $facebook = getFacebook();