aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Friends/FriendsService.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Services/Friends/FriendsService.cs26
1 files changed, 26 insertions, 0 deletions
diff --git a/OpenSim/Services/Friends/FriendsService.cs b/OpenSim/Services/Friends/FriendsService.cs
index 039dc0b..4664cb3 100644
--- a/OpenSim/Services/Friends/FriendsService.cs
+++ b/OpenSim/Services/Friends/FriendsService.cs
@@ -63,6 +63,32 @@ namespace OpenSim.Services.Friends
63 return info.ToArray(); 63 return info.ToArray();
64 } 64 }
65 65
66 public virtual FriendInfo[] GetFriends(string PrincipalID)
67 {
68 FriendsData[] data = m_Database.GetFriends(PrincipalID);
69 List<FriendInfo> info = new List<FriendInfo>();
70
71 foreach (FriendsData d in data)
72 {
73 FriendInfo i = new FriendInfo();
74
75 if (!UUID.TryParse(d.PrincipalID, out i.PrincipalID))
76 {
77 string tmp = string.Empty;
78 if (!Util.ParseUniversalUserIdentifier(d.PrincipalID, out i.PrincipalID, out tmp, out tmp, out tmp))
79 // bad record. ignore this entry
80 continue;
81 }
82 i.Friend = d.Friend;
83 i.MyFlags = Convert.ToInt32(d.Data["Flags"]);
84 i.TheirFlags = Convert.ToInt32(d.Data["TheirFlags"]);
85
86 info.Add(i);
87 }
88
89 return info.ToArray();
90 }
91
66 public virtual bool StoreFriend(string PrincipalID, string Friend, int flags) 92 public virtual bool StoreFriend(string PrincipalID, string Friend, int flags)
67 { 93 {
68 FriendsData d = new FriendsData(); 94 FriendsData d = new FriendsData();