diff options
author | Melanie | 2011-06-09 02:05:04 +0100 |
---|---|---|
committer | Melanie | 2011-06-09 02:05:04 +0100 |
commit | 326c46ba70cea70ddfe4aef9a6b73edff63e126a (patch) | |
tree | 5e76347b0d77f58717d8e5e4f3b8787ff01a18d7 /OpenSim/Data/MySQL/MySQLFriendsData.cs | |
parent | Make the last otem in a list created with llCSV2List findable (diff) | |
parent | Consistency fix on the last commit. (diff) | |
download | opensim-SC_OLD-326c46ba70cea70ddfe4aef9a6b73edff63e126a.zip opensim-SC_OLD-326c46ba70cea70ddfe4aef9a6b73edff63e126a.tar.gz opensim-SC_OLD-326c46ba70cea70ddfe4aef9a6b73edff63e126a.tar.bz2 opensim-SC_OLD-326c46ba70cea70ddfe4aef9a6b73edff63e126a.tar.xz |
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLFriendsData.cs')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLFriendsData.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/OpenSim/Data/MySQL/MySQLFriendsData.cs b/OpenSim/Data/MySQL/MySQLFriendsData.cs index 663fad6..130ba5e 100644 --- a/OpenSim/Data/MySQL/MySQLFriendsData.cs +++ b/OpenSim/Data/MySQL/MySQLFriendsData.cs | |||
@@ -44,6 +44,11 @@ namespace OpenSim.Data.MySQL | |||
44 | 44 | ||
45 | public bool Delete(UUID principalID, string friend) | 45 | public bool Delete(UUID principalID, string friend) |
46 | { | 46 | { |
47 | return Delete(principalID.ToString(), friend); | ||
48 | } | ||
49 | |||
50 | public bool Delete(string principalID, string friend) | ||
51 | { | ||
47 | MySqlCommand cmd = new MySqlCommand(); | 52 | MySqlCommand cmd = new MySqlCommand(); |
48 | 53 | ||
49 | cmd.CommandText = String.Format("delete from {0} where PrincipalID = ?PrincipalID and Friend = ?Friend", m_Realm); | 54 | cmd.CommandText = String.Format("delete from {0} where PrincipalID = ?PrincipalID and Friend = ?Friend", m_Realm); |
@@ -64,5 +69,14 @@ namespace OpenSim.Data.MySQL | |||
64 | 69 | ||
65 | return DoQuery(cmd); | 70 | return DoQuery(cmd); |
66 | } | 71 | } |
72 | |||
73 | public FriendsData[] GetFriends(string principalID) | ||
74 | { | ||
75 | MySqlCommand cmd = new MySqlCommand(); | ||
76 | |||
77 | cmd.CommandText = String.Format("select a.*,case when b.Flags is null then -1 else b.Flags end as TheirFlags from {0} as a left join {0} as b on a.PrincipalID = b.Friend and a.Friend = b.PrincipalID where a.PrincipalID LIKE ?PrincipalID", m_Realm); | ||
78 | cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString() + '%'); | ||
79 | return DoQuery(cmd); | ||
80 | } | ||
67 | } | 81 | } |
68 | } | 82 | } |