mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user