# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
--- cck_private_fields/modules/cck_private_fields_flag_friend/cck_private_fields_flag_friend.module
+++ cck_private_fields/modules/cck_private_fields_flag_friend/cck_private_fields_flag_friend.module
@@ -13,7 +13,13 @@
   $friend_flag = flag_get_flag('friend');
   if ($friend_flag) {
     // Grant access if both users are friends.
+    $flag_friend_api = flag_friend_views_api();
+    if ($flag_friend_api['api'] == 2) {
+      $friend_status = flag_friend_relationship_status($friend_flag, $node->uid, $account->uid);
+    }
+    else {
     $friend_status = flag_friend_determine_friend_status($friend_flag, $node->uid, $account->uid);
+    }
     return ($friend_status == FLAG_FRIEND_FLAGGED ? TRUE : FALSE);
   }
 
