aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs47
-rw-r--r--OpenSim/Region/Framework/Interfaces/IFriendsModule.cs2
2 files changed, 34 insertions, 15 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
index d6c4d5b..c88142a 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
@@ -217,7 +217,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
217 217
218 scene.EventManager.OnNewClient += OnNewClient; 218 scene.EventManager.OnNewClient += OnNewClient;
219 scene.EventManager.OnClientClosed += OnClientClosed; 219 scene.EventManager.OnClientClosed += OnClientClosed;
220 scene.EventManager.OnMakeRootAgent += OnMakeRootAgent; 220// scene.EventManager.OnMakeRootAgent += OnMakeRootAgent;
221 scene.EventManager.OnClientLogin += OnClientLogin; 221 scene.EventManager.OnClientLogin += OnClientLogin;
222 } 222 }
223 223
@@ -255,6 +255,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
255 return 0; 255 return 0;
256 } 256 }
257 257
258 private void OnMakeRootAgent(ScenePresence sp)
259 {
260 if(sp.gotCrossUpdate)
261 return;
262
263 RecacheFriends(sp.ControllingClient);
264
265 lock (m_NeedsToNotifyStatus)
266 {
267 if (m_NeedsToNotifyStatus.Remove(sp.UUID))
268 {
269 // Inform the friends that this user is online. This can only be done once the client is a Root Agent.
270 StatusChange(sp.UUID, true);
271 }
272 }
273 }
274
258 private void OnNewClient(IClientAPI client) 275 private void OnNewClient(IClientAPI client)
259 { 276 {
260 client.OnInstantMessage += OnInstantMessage; 277 client.OnInstantMessage += OnInstantMessage;
@@ -327,20 +344,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
327 } 344 }
328 } 345 }
329 346
330 private void OnMakeRootAgent(ScenePresence sp)
331 {
332 RecacheFriends(sp.ControllingClient);
333
334 lock (m_NeedsToNotifyStatus)
335 {
336 if (m_NeedsToNotifyStatus.Remove(sp.UUID))
337 {
338 // Inform the friends that this user is online. This can only be done once the client is a Root Agent.
339 StatusChange(sp.UUID, true);
340 }
341 }
342 }
343
344 private void OnClientLogin(IClientAPI client) 347 private void OnClientLogin(IClientAPI client)
345 { 348 {
346 UUID agentID = client.AgentId; 349 UUID agentID = client.AgentId;
@@ -359,6 +362,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
359 m_NeedsListOfOnlineFriends.Add(agentID); 362 m_NeedsListOfOnlineFriends.Add(agentID);
360 } 363 }
361 364
365 public void IsNpwRoot(ScenePresence sp)
366 {
367 RecacheFriends(sp.ControllingClient);
368
369 lock (m_NeedsToNotifyStatus)
370 {
371 if (m_NeedsToNotifyStatus.Remove(sp.UUID))
372 {
373 // Inform the friends that this user is online. This can only be done once the client is a Root Agent.
374 StatusChange(sp.UUID, true);
375 }
376 }
377 }
378
362 public virtual bool SendFriendsOnlineIfNeeded(IClientAPI client) 379 public virtual bool SendFriendsOnlineIfNeeded(IClientAPI client)
363 { 380 {
364 UUID agentID = client.AgentId; 381 UUID agentID = client.AgentId;
diff --git a/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs b/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs
index 7e87006..5c43b36 100644
--- a/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs
@@ -28,6 +28,7 @@
28using System.Collections.Generic; 28using System.Collections.Generic;
29using OpenMetaverse; 29using OpenMetaverse;
30using OpenSim.Framework; 30using OpenSim.Framework;
31using OpenSim.Region.Framework.Scenes;
31using FriendInfo = OpenSim.Services.Interfaces.FriendInfo; 32using FriendInfo = OpenSim.Services.Interfaces.FriendInfo;
32 33
33namespace OpenSim.Region.Framework.Interfaces 34namespace OpenSim.Region.Framework.Interfaces
@@ -93,6 +94,7 @@ namespace OpenSim.Region.Framework.Interfaces
93 /// <param name="perms">These come from the FriendRights enum.</param> 94 /// <param name="perms">These come from the FriendRights enum.</param>
94 void GrantRights(IClientAPI remoteClient, UUID friendID, int perms); 95 void GrantRights(IClientAPI remoteClient, UUID friendID, int perms);
95 96
97 void IsNpwRoot(ScenePresence sp);
96 bool SendFriendsOnlineIfNeeded(IClientAPI client); 98 bool SendFriendsOnlineIfNeeded(IClientAPI client);
97 } 99 }
98} \ No newline at end of file 100} \ No newline at end of file