Index: flag_friend.api.inc
===================================================================
RCS file: flag_friend.api.inc
diff -N flag_friend.api.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ flag_friend.api.inc	9 Jun 2009 22:57:54 -0000
@@ -0,0 +1,100 @@
+<?php
+
+/**
+ * @file
+ * Integration with universal relationship api
+ * @see http://drupal.org/project/drupal_universal_relation_api
+ */
+
+/**
+ * Implementation of hook_get_implementations().
+ */
+function flag_friend_get_implementations() {
+  return 'flag_friend';
+}
+
+/**
+ * Implementation of hook_is_related().
+ */
+function flag_friend_is_related($uid1, $uid2, $relation_name = NULL, $relation_style = 'all') {
+  $flag = flag_get_flag('friend');
+  $status = flag_friend_determine_friend_status($flag, $uid1, $uid2, TRUE);
+  return $status == FLAG_FRIEND_FLAGGED;
+}
+
+/**
+ * Implementation of hook_is_pending().
+ */
+function flag_friend_is_pending($uid1, $uid2, $relation_name = NULL, $relation_style = 'all') {
+  $flag = flag_get_flag('friend');
+  $status = flag_friend_determine_friend_status($flag, $uid1, $uid2, TRUE);
+  return $status == FLAG_FRIEND_APPROVAL;
+}
+
+/**
+ * Implementation of hook_is_blocked().
+ */
+function flag_friend_is_blocked($blocked_by_uid, $blocked_uid, $relation_name = NULL, $relation_style = 'all') {
+  // there isn't any blocking functionality within flag_friend
+  return FALSE;
+}
+
+/**
+ * Implementation of hook_get_related_users().
+ */
+function flag_friend_get_related_users($uid, $relation_name = NULL, $relation_style = 'all') {
+  $friends = flag_friend_get_friends($uid, TRUE);
+  if (!empty($friends)) {
+    return array_keys($friends);
+  }
+  return;
+}
+
+/**
+ * NOTE: Could these function be consolidated into one?
+ * IE: hook_all_pending()
+ * @see hook_all_pending_from().
+ * @see hook_all_pending_to().
+ */
+/**
+ * Implementation of hook_all_pending_from().
+ */
+function flag_friend_all_pending_from($uid, $relation_name = NULL, $relation_style = 'all') {
+  $flag = flag_get_flag('friend');
+  $pending = flag_friend_get_flags($flag, $uid, TRUE);
+  if (!empty($pending)) {
+    return array_keys($pending);
+  }
+  return;
+}
+
+/**
+ * Implementation of hook_all_pending_to().
+ */
+function flag_friend_all_pending_to($uid, $relation_name = NULL, $relation_style = 'all') {
+  $flag = flag_get_flag('friend');
+  $pending = flag_friend_get_flags($flag, $uid, TRUE);
+  if (!empty($pending)) {
+    return array_keys($pending);
+  }
+  return;
+}
+
+/**
+ * Implementation of hook_get_relation_names().
+ */
+function flag_friend_get_relation_names($relation_style = 'all') {
+  // flag_friend only implements one relationship type, return the title of the
+  // flag.
+  $flag = flag_get_flag('friend');
+  return $flag->title;
+}
+
+/**
+ * Implementation of hook_relation_type().
+ */
+function flag_friend_relation_type($relation_name) {
+  // flag_friend only implements two-way relationships. If a one way
+  // relationship is needed, you should be just using flag.
+  return 'two-way';
+}
\ No newline at end of file
Index: flag_friend.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/flag_friend/flag_friend.module,v
retrieving revision 1.3.4.30
diff -u -p -r1.3.4.30 flag_friend.module
--- flag_friend.module	9 Jun 2009 19:15:13 -0000	1.3.4.30
+++ flag_friend.module	9 Jun 2009 22:57:54 -0000
@@ -838,3 +838,9 @@ function flag_friend_preprocess_author_p
     }
   }
 }
+
+/**
+ * Integration with universal relationship api
+ * @see http://drupal.org/project/drupal_universal_relation_api
+ */
+include_once(drupal_get_path('module', 'flag_friend') .'/flag_friend.api.inc');
\ No newline at end of file
