diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index c952ebf..7a2a46e 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -165,7 +165,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
165 | 165 | ||
166 | // Instantiate the request handler | 166 | // Instantiate the request handler |
167 | IHttpServer server = MainServer.GetHttpServer((uint)mPort); | 167 | IHttpServer server = MainServer.GetHttpServer((uint)mPort); |
168 | server.AddStreamHandler(new FriendsRequestHandler(this)); | 168 | |
169 | if (server != null) | ||
170 | server.AddStreamHandler(new FriendsRequestHandler(this)); | ||
169 | } | 171 | } |
170 | 172 | ||
171 | if (m_FriendsService == null) | 173 | if (m_FriendsService == null) |
@@ -352,18 +354,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
352 | continue; | 354 | continue; |
353 | } | 355 | } |
354 | 356 | ||
355 | PresenceInfo presence = null; | ||
356 | PresenceInfo[] presences = PresenceService.GetAgents(new string[] { fid }); | ||
357 | if (presences != null && presences.Length > 0) | ||
358 | presence = presences[0]; | ||
359 | im.offline = 0; | 357 | im.offline = 0; |
360 | |||
361 | im.fromAgentID = fromAgentID.Guid; | 358 | im.fromAgentID = fromAgentID.Guid; |
362 | im.fromAgentName = firstname + " " + lastname; | 359 | im.fromAgentName = firstname + " " + lastname; |
363 | im.imSessionID = im.fromAgentID; | 360 | im.imSessionID = im.fromAgentID; |
364 | im.message = FriendshipMessage(fid); | 361 | im.message = FriendshipMessage(fid); |
365 | 362 | ||
366 | // Finally | ||
367 | LocalFriendshipOffered(agentID, im); | 363 | LocalFriendshipOffered(agentID, im); |
368 | } | 364 | } |
369 | 365 | ||
@@ -574,9 +570,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
574 | 570 | ||
575 | private void OnApproveFriendRequest(IClientAPI client, UUID agentID, UUID friendID, List<UUID> callingCardFolders) | 571 | private void OnApproveFriendRequest(IClientAPI client, UUID agentID, UUID friendID, List<UUID> callingCardFolders) |
576 | { | 572 | { |
577 | m_log.DebugFormat("[FRIENDS]: {0} accepted friendship from {1}", agentID, friendID); | 573 | m_log.DebugFormat("[FRIENDS]: {0} accepted friendship from {1}", client.AgentId, friendID); |
578 | 574 | ||
579 | StoreFriendships(agentID, friendID); | 575 | AddFriendship(client, friendID); |
576 | } | ||
577 | |||
578 | public void AddFriendship(IClientAPI client, UUID friendID) | ||
579 | { | ||
580 | StoreFriendships(client.AgentId, friendID); | ||
580 | 581 | ||
581 | // Update the local cache | 582 | // Update the local cache |
582 | RefetchFriends(client); | 583 | RefetchFriends(client); |
@@ -586,7 +587,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
586 | // | 587 | // |
587 | 588 | ||
588 | // Try Local | 589 | // Try Local |
589 | if (LocalFriendshipApproved(agentID, client.Name, friendID)) | 590 | if (LocalFriendshipApproved(client.AgentId, client.Name, friendID)) |
590 | { | 591 | { |
591 | client.SendAgentOnline(new UUID[] { friendID }); | 592 | client.SendAgentOnline(new UUID[] { friendID }); |
592 | return; | 593 | return; |
@@ -600,7 +601,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
600 | if (friendSession != null) | 601 | if (friendSession != null) |
601 | { | 602 | { |
602 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); | 603 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); |
603 | m_FriendsSimConnector.FriendshipApproved(region, agentID, client.Name, friendID); | 604 | m_FriendsSimConnector.FriendshipApproved(region, client.AgentId, client.Name, friendID); |
604 | client.SendAgentOnline(new UUID[] { friendID }); | 605 | client.SendAgentOnline(new UUID[] { friendID }); |
605 | } | 606 | } |
606 | } | 607 | } |
@@ -867,7 +868,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
867 | } | 868 | } |
868 | 869 | ||
869 | /// <summary> | 870 | /// <summary> |
870 | /// Update loca cache only | 871 | /// Update local cache only |
871 | /// </summary> | 872 | /// </summary> |
872 | /// <param name="userID"></param> | 873 | /// <param name="userID"></param> |
873 | /// <param name="friendID"></param> | 874 | /// <param name="friendID"></param> |