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
parent
a3f48a7ca6
commit
5908b8ed7c
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue