diff options
author | Diva Canto | 2011-05-21 16:48:00 -0700 |
---|---|---|
committer | Diva Canto | 2011-05-21 16:48:00 -0700 |
commit | 58c53c41de2cae0bb041a2e8121792e136d1edb2 (patch) | |
tree | b792158cd178f88234f86ab4d72c4224b45fe6ba /OpenSim/Services/Friends | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-58c53c41de2cae0bb041a2e8121792e136d1edb2.zip opensim-SC_OLD-58c53c41de2cae0bb041a2e8121792e136d1edb2.tar.gz opensim-SC_OLD-58c53c41de2cae0bb041a2e8121792e136d1edb2.tar.bz2 opensim-SC_OLD-58c53c41de2cae0bb041a2e8121792e136d1edb2.tar.xz |
Fixed permissions bug related to friends in PermissionsModule. Added FriendsData[] GetFriends(string principalID) to IFriendsData and FriendInfo[] GetFriends(string PrincipalID) to IFriendsService. Refactored some more in the FriendsModule. Made client get notification of local friends permissions upon HGLogin. HG Friends object permissions work.
Diffstat (limited to 'OpenSim/Services/Friends')
-rw-r--r-- | OpenSim/Services/Friends/FriendsService.cs | 26 |
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(); |