diff --git a/actions/facebookhome.php b/actions/facebookhome.php
index b261e6a8c3..8ee2d4cd36 100644
--- a/actions/facebookhome.php
+++ b/actions/facebookhome.php
@@ -34,7 +34,6 @@ class FacebookhomeAction extends FacebookAction {
$user = null;
$facebook = $this->get_facebook();
-
$fbuid = $facebook->require_login();
# check to see whether there's already a Facebook link for this user
@@ -42,21 +41,12 @@ class FacebookhomeAction extends FacebookAction {
if ($flink) {
- $this->display($facebook, $fbuid);
-
$user = $flink->getUser();
-
-
- $notice = $user->getCurrentNotice();
-
- echo $this->show_notices($user);
-
-
- $this->update_profile_box($facebook, $fbuid, $user);
-
+ $this->show_home($facebook, $fbuid, $user);
} else {
+ # Make the user put in her Laconica creds
$nickname = common_canonical_nickname($this->trimmed('nickname'));
$password = $this->arg('password');
@@ -64,12 +54,11 @@ class FacebookhomeAction extends FacebookAction {
if (common_check_user($nickname, $password)) {
- echo '
Successful authentication!
';
$user = User::staticGet('nickname', $nickname);
if (!$user) {
- echo 'Couldn\'t get user!
';
+ echo '';
$this->show_login_form();
}
@@ -84,16 +73,15 @@ class FacebookhomeAction extends FacebookAction {
$flink_id = $flink->insert();
if ($flink_id) {
- echo 'Successfully made Identi.ca -> Facebook link
';
+ echo '';
}
- $this->display($facebook, $fbuid);
+ $this->show_home($facebook, $fbuid, $user);
return;
} else {
- echo 'Fail!
';
+ echo '';
}
-
}
$this->show_login_form();
@@ -101,17 +89,16 @@ class FacebookhomeAction extends FacebookAction {
}
- function display($facebook, $fbuid) {
+ function show_home($facebook, $fbuid, $user) {
$this->show_header('Home');
- // Greet the currently logged-in user!
- echo "Hello, !
";
+ echo $this->show_notices($user);
+ $this->update_profile_box($facebook, $fbuid, $user);
$this->show_footer();
}
-
function show_notices($user) {
$page = $this->trimmed('page');
@@ -142,58 +129,4 @@ class FacebookhomeAction extends FacebookAction {
}
-
-
- function update_profile_box($facebook, $fbuid, $user) {
-
- $notice = $user->getCurrentNotice();
-
- # Need to include CSS for styling the Profile box
-
- $style = '';
-
- $html = $this->render_notice($notice);
-
- $fbml = "$content $html";
- $fbml .= "$content $html";
-
- $fbml_main = "$content $html";
-
- $facebook->api_client->profile_setFBML(NULL, $fbuid, $fbml, NULL, NULL, $fbml_main);
-
- }
-
}
diff --git a/lib/facebookaction.php b/lib/facebookaction.php
index 8872934aae..d5f0adbb88 100644
--- a/lib/facebookaction.php
+++ b/lib/facebookaction.php
@@ -33,6 +33,56 @@ class FacebookAction extends Action {
return new Facebook($apikey, $secret);
}
+ function update_profile_box($facebook, $fbuid, $user) {
+
+ $notice = $user->getCurrentNotice();
+
+ # Need to include inline CSS for styling the Profile box
+
+ $style = '';
+
+ $html = $this->render_notice($notice);
+
+ $fbml = "$content $html";
+ $fbml .= "$content $html";
+
+ $fbml_main = "$content $html";
+
+ $facebook->api_client->profile_setFBML(NULL, $fbuid, $fbml, NULL, NULL, $fbml_main);
+ }
# Display methods
@@ -180,14 +230,14 @@ class FacebookAction extends Action {
return $html;
}
-
+
function pagination($have_before, $have_after, $page, $fbaction, $args=NULL) {
$html = '';
if ($have_before || $have_after) {
$html = '