several changes to llIsFriend and related methods

This commit is contained in:
UbitUmarov
2024-02-16 20:14:06 +00:00
parent 089037c749
commit cf27093ee9
7 changed files with 118 additions and 32 deletions

View File

@@ -207,7 +207,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
if (!m_Enabled)
return;
// m_log.DebugFormat("[FRIENDS MODULE]: AddRegion on {0}", Name);
//m_log.DebugFormat("[FRIENDS MODULE]: AddRegion on {0}", Name);
m_Scenes.Add(scene);
scene.RegisterModuleInterface<IFriendsModule>(this);
@@ -254,6 +254,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
return 0;
}
public bool IsFriend(UUID principalID, UUID friendID)
{
FriendInfo[] friends = GetFriendsFromCache(principalID);
if (friends.Length > 0)
{
FriendInfo finfo = GetFriend(friends, friendID);
return (finfo is not null && finfo.TheirFlags != -1);
}
return false;
}
public bool IsFriendOnline(UUID userID, UUID friendID)
{
if(m_OnlineFriendsCache.TryGetValue(userID, out HashSet<UUID> friends))