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

View File

@ -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;
}
}

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);
foreach (FriendListItem item in profile)
{
if (item.Friend == objectOwner && (item.FriendPerms & (uint)FriendRights.CanModifyObjects) != 0)
uint friendPerms = m_friendsModule.GetFriendPerms(user, objectOwner);
if ((friendPerms & (uint)FriendRights.CanModifyObjects) != 0)
return true;
}
return false;
}

View File

@ -46,6 +46,6 @@ namespace OpenSim.Region.Framework.Interfaces
/// </param>
/// <param name="offerMessage"></param>
void OfferFriendship(UUID fromUserId, IClientAPI toUserClient, string offerMessage);
List<FriendListItem> GetUserFriends(UUID agentID);
uint GetFriendPerms(UUID PrincipalID, UUID FriendID);
}
}