aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-11-14 18:08:02 +0000
committerJustin Clark-Casey (justincc)2011-11-14 18:08:02 +0000
commit348d15707d129c99bc79cd35d544bc62b9a6f1b2 (patch)
treee1377950e09d753d2979134dd96e253ce83e5be9 /OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
parentAdd very simple FriendsModuleTests.TestNoFriends() (diff)
downloadopensim-SC-348d15707d129c99bc79cd35d544bc62b9a6f1b2.zip
opensim-SC-348d15707d129c99bc79cd35d544bc62b9a6f1b2.tar.gz
opensim-SC-348d15707d129c99bc79cd35d544bc62b9a6f1b2.tar.bz2
opensim-SC-348d15707d129c99bc79cd35d544bc62b9a6f1b2.tar.xz
Add test for adding a friend whilst online
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs15
1 files changed, 10 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
index 28a2f73..f4281e5 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
@@ -576,9 +576,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
576 576
577 private void OnApproveFriendRequest(IClientAPI client, UUID agentID, UUID friendID, List<UUID> callingCardFolders) 577 private void OnApproveFriendRequest(IClientAPI client, UUID agentID, UUID friendID, List<UUID> callingCardFolders)
578 { 578 {
579 m_log.DebugFormat("[FRIENDS]: {0} accepted friendship from {1}", agentID, friendID); 579 m_log.DebugFormat("[FRIENDS]: {0} accepted friendship from {1}", client.AgentId, friendID);
580 580
581 StoreFriendships(agentID, friendID); 581 AddFriend(client, friendID);
582 }
583
584 public void AddFriend(IClientAPI client, UUID friendID)
585 {
586 StoreFriendships(client.AgentId, friendID);
582 587
583 // Update the local cache 588 // Update the local cache
584 RefetchFriends(client); 589 RefetchFriends(client);
@@ -588,7 +593,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
588 // 593 //
589 594
590 // Try Local 595 // Try Local
591 if (LocalFriendshipApproved(agentID, client.Name, friendID)) 596 if (LocalFriendshipApproved(client.AgentId, client.Name, friendID))
592 { 597 {
593 client.SendAgentOnline(new UUID[] { friendID }); 598 client.SendAgentOnline(new UUID[] { friendID });
594 return; 599 return;
@@ -602,7 +607,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
602 if (friendSession != null) 607 if (friendSession != null)
603 { 608 {
604 GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); 609 GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
605 m_FriendsSimConnector.FriendshipApproved(region, agentID, client.Name, friendID); 610 m_FriendsSimConnector.FriendshipApproved(region, client.AgentId, client.Name, friendID);
606 client.SendAgentOnline(new UUID[] { friendID }); 611 client.SendAgentOnline(new UUID[] { friendID });
607 } 612 }
608 } 613 }
@@ -869,7 +874,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
869 } 874 }
870 875
871 /// <summary> 876 /// <summary>
872 /// Update loca cache only 877 /// Update local cache only
873 /// </summary> 878 /// </summary>
874 /// <param name="userID"></param> 879 /// <param name="userID"></param>
875 /// <param name="friendID"></param> 880 /// <param name="friendID"></param>