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.
This commit is contained in:
Melanie
2010-01-19 11:33:42 +00:00
parent a3f48a7ca6
commit 5908b8ed7c
4 changed files with 6 additions and 11 deletions

View File

@@ -84,9 +84,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
{
}
public List<FriendListItem> GetUserFriends(UUID agentID)
public uint GetFriendPerms(UUID principalID, UUID friendID)
{
return null;
return 1;
}
}
}

View File

@@ -504,13 +504,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (m_friendsModule == null)
return false;
List<FriendListItem> 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;
}