From 06e254c392c754bf7e7a1c80400a3ef5b1a82ca3 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 11 Jun 2011 17:48:19 -0700 Subject: [PATCH] A few more cleanups on the way to close http://opensimulator.org/mantis/view.php?id=5516 once and for all. Moral of the story: don't send AgentOnline/Offline to viewers with a zero-length array. --- .../CoreModules/Avatar/Friends/HGFriendsModule.cs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs index 2c915140fe..dda67f9c2b 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs @@ -280,10 +280,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends List ids = new List(); foreach (FriendInfo f in kvp.Value) ids.Add(f.Friend); - UserAgentServiceConnector uConn = new UserAgentServiceConnector(kvp.Key, false); + UserAgentServiceConnector uConn = new UserAgentServiceConnector(kvp.Key); List friendsOnline = uConn.StatusNotification(ids, userID, online); - Thread.Sleep(100); - // need to debug this here + if (online && friendsOnline.Count > 0) { IClientAPI client = LocateClientObject(userID); @@ -305,15 +304,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends if (Util.ParseUniversalUserIdentifier(fid, out agentID, out url, out first, out last, out tmp)) { IUserManagement userMan = m_Scenes[0].RequestModuleInterface(); - userMan.AddUser(agentID, url + ";" + first + " " + last); + userMan.AddUser(agentID, first, last, url); - try // our best - { - string[] parts = userMan.GetUserName(agentID).Split(); - first = parts[0]; - last = parts[1]; - } - catch { } return true; } return false;