diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs index 27b7376..9954749 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs | |||
@@ -337,7 +337,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
337 | if (UUID.TryParse(friendID, out id)) | 337 | if (UUID.TryParse(friendID, out id)) |
338 | return base.FriendshipMessage(friendID); | 338 | return base.FriendshipMessage(friendID); |
339 | 339 | ||
340 | return "Please confirm this friendship you made while you were away."; | 340 | return "Please confirm this friendship you made while you where on another HG grid"; |
341 | } | 341 | } |
342 | 342 | ||
343 | protected override FriendInfo GetFriend(FriendInfo[] friends, UUID friendID) | 343 | protected override FriendInfo GetFriend(FriendInfo[] friends, UUID friendID) |
@@ -456,6 +456,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
456 | { | 456 | { |
457 | // local grid users | 457 | // local grid users |
458 | m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local"); | 458 | m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local"); |
459 | DeletePreviousHGRelations(agentID, friendID); | ||
459 | base.StoreFriendships(agentID, friendID); | 460 | base.StoreFriendships(agentID, friendID); |
460 | return; | 461 | return; |
461 | } | 462 | } |
@@ -624,6 +625,45 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
624 | } | 625 | } |
625 | } | 626 | } |
626 | 627 | ||
628 | private void DeletePreviousHGRelations(UUID a1, UUID a2) | ||
629 | { | ||
630 | // Delete any previous friendship relations | ||
631 | FriendInfo[] finfos = null; | ||
632 | finfos = GetFriendsFromCache(a1); | ||
633 | if (finfos != null) | ||
634 | { | ||
635 | foreach (FriendInfo f in finfos) | ||
636 | { | ||
637 | if (f.TheirFlags == -1) | ||
638 | { | ||
639 | if (f.Friend.StartsWith(a2.ToString())) | ||
640 | { | ||
641 | FriendsService.Delete(a1, f.Friend); | ||
642 | // and also the converse | ||
643 | FriendsService.Delete(f.Friend, a1.ToString()); | ||
644 | } | ||
645 | } | ||
646 | } | ||
647 | } | ||
648 | |||
649 | finfos = GetFriendsFromCache(a1); | ||
650 | if (finfos != null) | ||
651 | { | ||
652 | foreach (FriendInfo f in finfos) | ||
653 | { | ||
654 | if (f.TheirFlags == -1) | ||
655 | { | ||
656 | if (f.Friend.StartsWith(a1.ToString())) | ||
657 | { | ||
658 | FriendsService.Delete(a2, f.Friend); | ||
659 | // and also the converse | ||
660 | FriendsService.Delete(f.Friend, a2.ToString()); | ||
661 | } | ||
662 | } | ||
663 | } | ||
664 | } | ||
665 | } | ||
666 | |||
627 | protected override bool DeleteFriendship(UUID agentID, UUID exfriendID) | 667 | protected override bool DeleteFriendship(UUID agentID, UUID exfriendID) |
628 | { | 668 | { |
629 | Boolean agentIsLocal = true; | 669 | Boolean agentIsLocal = true; |