From fdecf8001694109e045d8421c9e3ebd6cb6c219e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 1 Feb 2020 15:26:58 +0000 Subject: [PATCH] mantis 8654: exclude NPCs from some Friends ops --- OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 39bf46c619..3fb09b6cd3 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -274,6 +274,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends private void OnNewClient(IClientAPI client) { client.OnInstantMessage += OnInstantMessage; + + if (client is INPC) + return; + client.OnApproveFriendRequest += OnApproveFriendRequest; client.OnDenyFriendRequest += OnDenyFriendRequest; client.OnTerminateFriendship += RemoveFriendship; @@ -640,7 +644,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends protected virtual void OnApproveFriendRequest(IClientAPI client, UUID friendID, List callingCardFolders) { m_log.DebugFormat("[FRIENDS]: {0} accepted friendship from {1}", client.AgentId, friendID); - AddFriendship(client, friendID); }