summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fb_user.module15
1 files changed, 11 insertions, 4 deletions
diff --git a/fb_user.module b/fb_user.module
index 5fcae72..e1347c0 100644
--- a/fb_user.module
+++ b/fb_user.module
@@ -1146,9 +1146,11 @@ function fb_user_token_values($type = 'all', $object = NULL) {
}
/**
- * Learn the user's proxied email address.
- * If fb_user_app.module is enabled, it will defer to that module, which queries a local database.
- * If not, ask facebook for the data.
+ * Learn the user's proxied email address. If fb_user_app.module is enabled,
+ * it will defer to that module, which queries a local database. If not, ask
+ * facebook for the data.
+ *
+ * @TODO: Facebook may no longer provide proxied_email. Does this work?
*/
function fb_user_get_proxied_email($fbu, $fb_app) {
$mail = "";
@@ -1163,7 +1165,12 @@ function fb_user_get_proxied_email($fbu, $fb_app) {
$fb = fb_api_init($fb_app);
$info = fb_users_getInfo(array($fbu), $fb); // TODO deprecated
$data = $info;
- $mail = $data['proxied_email'];
+ if (isset($data['email'])) {
+ $mail = $data['email'];
+ }
+ elseif (isset($data['proxied_email'])) {
+ $mail = $data['proxied_email'];
+ }
}
return $mail;