From c6adbccc27141109f27c9cb9e65fea2b08b07850 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sun, 7 Feb 2010 12:06:00 +0000
Subject: Finish the "Get friends" method

---
 OpenSim/Data/MySQL/MySQLFriendsData.cs | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Data/MySQL/MySQLFriendsData.cs b/OpenSim/Data/MySQL/MySQLFriendsData.cs
index 9f7e850..e416eea 100644
--- a/OpenSim/Data/MySQL/MySQLFriendsData.cs
+++ b/OpenSim/Data/MySQL/MySQLFriendsData.cs
@@ -57,7 +57,12 @@ namespace OpenSim.Data.MySQL
 
         public FriendsData[] GetFriends(UUID principalID)
         {
-            return Get("PrincipalID", principalID.ToString());
+            MySqlCommand cmd = new MySqlCommand();
+
+            cmd.CommandText = String.Format("select a.*,b.Flags as TheirFlags from {0} as a left join {0} as b on a.PrincipalID = b.Friend and a.Friend = b.PrincipalID where a.PrincipalID = ?PrincipalID", m_Realm);
+            cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString());
+
+            return DoQuery(cmd);
         }
     }
 }
-- 
cgit v1.1