You are here

function fb_friend_fb_friend in Drupal for Facebook 6.3

Same name and namespace in other branches
  1. 7.3 contrib/fb_friend.module \fb_friend_fb_friend()

Implements hook_fb_friend().

File

contrib/fb_friend.module, line 321
This module implements several features specific to Facebook friend networks.

Code

function fb_friend_fb_friend($op, $data, &$return) {
  if ($data['module'] != 'fb_friend_invite_app') {
    return;
  }
  if ($data['delta'] == FB_FRIEND_DELTA_INVITE_APP) {
    if ($op == FB_FRIEND_OP_REQUEST_SUBMIT) {

      // Save the invites to fb_friend table.
      $data['data'] = serialize(array(
        'delta' => $data['delta'],
      ));
      $results = fb_friend_write_records($data, $data['ids']);
      $return = $data['next'];
    }
    elseif ($op == FB_FRIEND_OP_REQUEST_SKIP) {
      $return = $data['next'];
    }
    elseif ($op == FB_FRIEND_OP_REQUEST_ACCEPT) {

      // @TODO present a connect button?
      $return = '<front>';
    }
  }
}