Index: friend.api.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/friend/friend.api.inc,v
retrieving revision 1.17
diff -u -p -r1.17 friend.api.inc
--- friend.api.inc	12 Jul 2008 21:27:08 -0000	1.17
+++ friend.api.inc	17 Sep 2008 15:16:01 -0000
@@ -191,22 +191,31 @@ function friendapi_list_member($uid,$lid
  *
  * @param $uid
  * 	the user
+ * @param $list_id
+ *  the list by which to filter
+ * @param $back
+ *  A boolen to toggle 'people who are friends of me' 
+ *   vs. 'people I am the friend of'
  * @return
  *	an array of friends belonging to $uid
  */
-function friendapi_friend_list($uid,$list_id=null){
+function friendapi_friend_list($uid,$list_id=null,$back=false){
+
+  $col = 'uid';
+  if($back)
+    $col = 'fid';
 
 	if ($list_id == null){
 		$SQL = "SELECT U.* 
 				FROM {users} U
 					INNER JOIN {friend} F on U.uid = F.fid
-				WHERE F.uid = %d
+				WHERE F.$col = %d
 		";
 	}else{
 		$SQL = "SELECT U.* 
 				FROM {users} U
 					INNER JOIN {friend} F on U.uid = F.fid
-				WHERE F.status = 1 AND F.uid = %d
+				WHERE F.status = 1 AND F.$col = %d
 					AND U.uid NOT IN (
 						SELECT uid FROM {friend_list_member}
 						WHERE lid = '$list_id'
