aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2010-01-19 11:33:42 +0000
committerMelanie2010-01-19 11:33:42 +0000
commit5908b8ed7c273d239642a9d31e1844f9a2392e3d (patch)
tree72c71bf6501a5d963ab4ae801c5ade29f5cdcb42 /OpenSim
parentMerge branch 'presence-refactor' of melanie@opensimulator.org:/var/git/opensi... (diff)
downloadopensim-SC_OLD-5908b8ed7c273d239642a9d31e1844f9a2392e3d.zip
opensim-SC_OLD-5908b8ed7c273d239642a9d31e1844f9a2392e3d.tar.gz
opensim-SC_OLD-5908b8ed7c273d239642a9d31e1844f9a2392e3d.tar.bz2
opensim-SC_OLD-5908b8ed7c273d239642a9d31e1844f9a2392e3d.tar.xz
Change a member of the friendslist module to better reflect the client side
data storage paradigm of the friends list and avoid repeated, unneccessary fetches of the entire friends list.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/FriendListItem.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs9
-rw-r--r--OpenSim/Region/Framework/Interfaces/IFriendsModule.cs2
4 files changed, 6 insertions, 11 deletions
diff --git a/OpenSim/Framework/FriendListItem.cs b/OpenSim/Framework/FriendListItem.cs
index 39e2363..a02ec7f 100644
--- a/OpenSim/Framework/FriendListItem.cs
+++ b/OpenSim/Framework/FriendListItem.cs
@@ -39,7 +39,5 @@ namespace OpenSim.Framework
39 39
40 // These are what the friend gives the listowner permission to do 40 // These are what the friend gives the listowner permission to do
41 public uint FriendPerms; 41 public uint FriendPerms;
42
43 public bool onlinestatus = false;
44 } 42 }
45} 43}
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
index 64854b2..a07b6e2 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
@@ -84,9 +84,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
84 { 84 {
85 } 85 }
86 86
87 public List<FriendListItem> GetUserFriends(UUID agentID) 87 public uint GetFriendPerms(UUID principalID, UUID friendID)
88 { 88 {
89 return null; 89 return 1;
90 } 90 }
91 } 91 }
92} 92}
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 8fa0c65..72dd373 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -504,13 +504,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions
504 if (m_friendsModule == null) 504 if (m_friendsModule == null)
505 return false; 505 return false;
506 506
507 List<FriendListItem> profile = m_friendsModule.GetUserFriends(user); 507 uint friendPerms = m_friendsModule.GetFriendPerms(user, objectOwner);
508 if ((friendPerms & (uint)FriendRights.CanModifyObjects) != 0)
509 return true;
508 510
509 foreach (FriendListItem item in profile)
510 {
511 if (item.Friend == objectOwner && (item.FriendPerms & (uint)FriendRights.CanModifyObjects) != 0)
512 return true;
513 }
514 return false; 511 return false;
515 } 512 }
516 513
diff --git a/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs b/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs
index 8386030..239a2ba 100644
--- a/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs
@@ -46,6 +46,6 @@ namespace OpenSim.Region.Framework.Interfaces
46 /// </param> 46 /// </param>
47 /// <param name="offerMessage"></param> 47 /// <param name="offerMessage"></param>
48 void OfferFriendship(UUID fromUserId, IClientAPI toUserClient, string offerMessage); 48 void OfferFriendship(UUID fromUserId, IClientAPI toUserClient, string offerMessage);
49 List<FriendListItem> GetUserFriends(UUID agentID); 49 uint GetFriendPerms(UUID PrincipalID, UUID FriendID);
50 } 50 }
51} 51}