From 98a2fa8e358a6a008eea28161e48e4bfc877e11e Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Thu, 4 Jul 2013 10:23:20 -0700
Subject: HG Friends: this was commented some commits ago, but it shouldn't
 have been.

---
 .../CoreModules/Avatar/Friends/HGFriendsModule.cs  | 49 +++++++++++-----------
 1 file changed, 24 insertions(+), 25 deletions(-)

diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
index ae45b99..6d1fd1f 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
@@ -348,31 +348,30 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
             return null;
         }
 
-//        public override FriendInfo[] GetFriendsFromService(IClientAPI client)
-//        {
-////            m_log.DebugFormat("[HGFRIENDS MODULE]: Entering GetFriendsFromService for {0}", client.Name);
-//            Boolean agentIsLocal = true;
-//            if (UserManagementModule != null)
-//                agentIsLocal = UserManagementModule.IsLocalGridUser(client.AgentId);
-
-//            if (agentIsLocal)
-//                return base.GetFriendsFromService(client);
-
-//            FriendInfo[] finfos = new FriendInfo[0];
-//            // Foreigner
-//            AgentCircuitData agentClientCircuit = ((Scene)(client.Scene)).AuthenticateHandler.GetAgentCircuitData(client.CircuitCode);
-//            if (agentClientCircuit != null)
-//            {
-//                //[XXX] string agentUUI = Util.ProduceUserUniversalIdentifier(agentClientCircuit);
-
-//                finfos = FriendsService.GetFriends(client.AgentId.ToString());
-//                m_log.DebugFormat("[HGFRIENDS MODULE]: Fetched {0} local friends for visitor {1}", finfos.Length, client.AgentId.ToString());
-//            }
-
-////            m_log.DebugFormat("[HGFRIENDS MODULE]: Exiting GetFriendsFromService for {0}", client.Name);
-
-//            return finfos;
-//        }
+        public override FriendInfo[] GetFriendsFromService(IClientAPI client)
+        {
+            //            m_log.DebugFormat("[HGFRIENDS MODULE]: Entering GetFriendsFromService for {0}", client.Name);
+            Boolean agentIsLocal = true;
+            if (UserManagementModule != null)
+                agentIsLocal = UserManagementModule.IsLocalGridUser(client.AgentId);
+
+            if (agentIsLocal)
+                return base.GetFriendsFromService(client);
+
+            FriendInfo[] finfos = new FriendInfo[0];
+            // Foreigner
+            AgentCircuitData agentClientCircuit = ((Scene)(client.Scene)).AuthenticateHandler.GetAgentCircuitData(client.CircuitCode);
+            if (agentClientCircuit != null)
+            {
+                // Note that this is calling a different interface than base; this one calls with a string param!
+                finfos = FriendsService.GetFriends(client.AgentId.ToString());
+                m_log.DebugFormat("[HGFRIENDS MODULE]: Fetched {0} local friends for visitor {1}", finfos.Length, client.AgentId.ToString());
+            }
+
+            //            m_log.DebugFormat("[HGFRIENDS MODULE]: Exiting GetFriendsFromService for {0}", client.Name);
+
+            return finfos;
+        }
 
         protected override bool StoreRights(UUID agentID, UUID friendID, int rights)
         {
-- 
cgit v1.1