diff options
author | Melanie | 2011-11-14 20:03:47 +0000 |
---|---|---|
committer | Melanie | 2011-11-14 20:03:47 +0000 |
commit | afca742392e30748de13a125f932046949af0bcb (patch) | |
tree | 34e9dd92533abe446e356d9fb1ad8625cb28c9bc /OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |
parent | Merge branch 'master' into bigmerge (diff) | |
parent | minor: remove some mono compiler warnings (diff) | |
download | opensim-SC-afca742392e30748de13a125f932046949af0bcb.zip opensim-SC-afca742392e30748de13a125f932046949af0bcb.tar.gz opensim-SC-afca742392e30748de13a125f932046949af0bcb.tar.bz2 opensim-SC-afca742392e30748de13a125f932046949af0bcb.tar.xz |
Merge branch 'master' into bigmerge
Conflicts:
OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index a5131ec..74f32e7 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,20 +354,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
352 | continue; | 354 | continue; |
353 | } | 355 | } |
354 | 356 | ||
355 | PresenceInfo presence = null; | 357 | im.offline = 0; |
356 | PresenceInfo[] presences = PresenceService.GetAgents(new string[] { fid }); | ||
357 | if (presences != null && presences.Length > 0) | ||
358 | presence = presences[0]; | ||
359 | if (presence != null) | ||
360 | im.offline = 0; | ||
361 | |||
362 | im.fromAgentID = fromAgentID.Guid; | 358 | im.fromAgentID = fromAgentID.Guid; |
363 | im.fromAgentName = firstname + " " + lastname; | 359 | im.fromAgentName = firstname + " " + lastname; |
364 | im.offline = (byte)((presence == null) ? 1 : 0); | 360 | im.offline = (byte)((presence == null) ? 1 : 0); |
365 | im.imSessionID = im.fromAgentID; | 361 | im.imSessionID = im.fromAgentID; |
366 | im.message = FriendshipMessage(fid); | 362 | im.message = FriendshipMessage(fid); |
367 | 363 | ||
368 | // Finally | ||
369 | LocalFriendshipOffered(agentID, im); | 364 | LocalFriendshipOffered(agentID, im); |
370 | } | 365 | } |
371 | 366 | ||
@@ -576,9 +571,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
576 | 571 | ||
577 | private void OnApproveFriendRequest(IClientAPI client, UUID agentID, UUID friendID, List<UUID> callingCardFolders) | 572 | private void OnApproveFriendRequest(IClientAPI client, UUID agentID, UUID friendID, List<UUID> callingCardFolders) |
578 | { | 573 | { |
579 | m_log.DebugFormat("[FRIENDS]: {0} accepted friendship from {1}", agentID, friendID); | 574 | m_log.DebugFormat("[FRIENDS]: {0} accepted friendship from {1}", client.AgentId, friendID); |
580 | 575 | ||
581 | StoreFriendships(agentID, friendID); | 576 | AddFriend(client, friendID); |
577 | } | ||
578 | |||
579 | public void AddFriend(IClientAPI client, UUID friendID) | ||
580 | { | ||
581 | StoreFriendships(client.AgentId, friendID); | ||
582 | 582 | ||
583 | ICallingCardModule ccm = client.Scene.RequestModuleInterface<ICallingCardModule>(); | 583 | ICallingCardModule ccm = client.Scene.RequestModuleInterface<ICallingCardModule>(); |
584 | if (ccm != null) | 584 | if (ccm != null) |
@@ -594,7 +594,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
594 | // | 594 | // |
595 | 595 | ||
596 | // Try Local | 596 | // Try Local |
597 | if (LocalFriendshipApproved(agentID, client.Name, friendID)) | 597 | if (LocalFriendshipApproved(client.AgentId, client.Name, friendID)) |
598 | { | 598 | { |
599 | client.SendAgentOnline(new UUID[] { friendID }); | 599 | client.SendAgentOnline(new UUID[] { friendID }); |
600 | return; | 600 | return; |
@@ -608,7 +608,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
608 | if (friendSession != null) | 608 | if (friendSession != null) |
609 | { | 609 | { |
610 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); | 610 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); |
611 | m_FriendsSimConnector.FriendshipApproved(region, agentID, client.Name, friendID); | 611 | m_FriendsSimConnector.FriendshipApproved(region, client.AgentId, client.Name, friendID); |
612 | client.SendAgentOnline(new UUID[] { friendID }); | 612 | client.SendAgentOnline(new UUID[] { friendID }); |
613 | } | 613 | } |
614 | } | 614 | } |
@@ -882,7 +882,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
882 | } | 882 | } |
883 | 883 | ||
884 | /// <summary> | 884 | /// <summary> |
885 | /// Update loca cache only | 885 | /// Update local cache only |
886 | /// </summary> | 886 | /// </summary> |
887 | /// <param name="userID"></param> | 887 | /// <param name="userID"></param> |
888 | /// <param name="friendID"></param> | 888 | /// <param name="friendID"></param> |