From 5908b8ed7c273d239642a9d31e1844f9a2392e3d Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 19 Jan 2010 11:33:42 +0000 Subject: 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. --- OpenSim/Framework/FriendListItem.cs | 2 -- OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | 4 ++-- .../Region/CoreModules/World/Permissions/PermissionsModule.cs | 9 +++------ OpenSim/Region/Framework/Interfaces/IFriendsModule.cs | 2 +- 4 files changed, 6 insertions(+), 11 deletions(-) (limited to 'OpenSim') 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 // These are what the friend gives the listowner permission to do public uint FriendPerms; - - public bool onlinestatus = false; } } 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 { } - public List GetUserFriends(UUID agentID) + public uint GetFriendPerms(UUID principalID, UUID friendID) { - return null; + return 1; } } } 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 if (m_friendsModule == null) return false; - List profile = m_friendsModule.GetUserFriends(user); + uint friendPerms = m_friendsModule.GetFriendPerms(user, objectOwner); + if ((friendPerms & (uint)FriendRights.CanModifyObjects) != 0) + return true; - foreach (FriendListItem item in profile) - { - if (item.Friend == objectOwner && (item.FriendPerms & (uint)FriendRights.CanModifyObjects) != 0) - return true; - } return false; } 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 /// /// void OfferFriendship(UUID fromUserId, IClientAPI toUserClient, string offerMessage); - List GetUserFriends(UUID agentID); + uint GetFriendPerms(UUID PrincipalID, UUID FriendID); } } -- cgit v1.1