Improved method doc for AddFriend() - it actually does set up a two-way relationship.

Rename IFriendsModule.AddFriend() to AddFriendship()
0.7.2-post-fixes
Justin Clark-Casey (justincc) 2011-11-14 20:31:16 +00:00
parent 8f7f03e7fd
commit 8b5bacc78b
3 changed files with 7 additions and 9 deletions

View File

@ -580,10 +580,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
{
m_log.DebugFormat("[FRIENDS]: {0} accepted friendship from {1}", client.AgentId, friendID);
AddFriend(client, friendID);
AddFriendship(client, friendID);
}
public void AddFriend(IClientAPI client, UUID friendID)
public void AddFriendship(IClientAPI client, UUID friendID)
{
StoreFriendships(client.AgentId, friendID);

View File

@ -87,8 +87,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends.Tests
ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, userId);
ScenePresence sp2 = SceneHelpers.AddScenePresence(m_scene, user2Id);
// This friendship is currently only one-way, which might be pathalogical in Second Life.
m_fm.AddFriend(sp.ControllingClient, user2Id);
// This fiendship is two-way but without a connector, only the first user will receive the online
// notification.
m_fm.AddFriendship(sp.ControllingClient, user2Id);
Assert.That(((TestClient)sp.ControllingClient).OfflineNotificationsReceived.Count, Is.EqualTo(0));
Assert.That(((TestClient)sp.ControllingClient).OnlineNotificationsReceived.Count, Is.EqualTo(1));

View File

@ -34,18 +34,15 @@ namespace OpenSim.Region.Framework.Interfaces
public interface IFriendsModule
{
/// <summary>
/// Add a friend for the given user.
/// Add a friendship between two users.
/// </summary>
/// <remarks>
/// This is a one-way friendship. To make a two way friendship you will need to call this again with the
/// client and friend reversed.
///
/// Ultimately, it would be more useful to take in a user account here rather than having to have a user
/// present in the scene.
/// </remarks>
/// <param name="client"></param>
/// <param name="friendID"></param>
void AddFriend(IClientAPI client, UUID friendID);
void AddFriendship(IClientAPI client, UUID friendID);
uint GetFriendPerms(UUID PrincipalID, UUID FriendID);
bool SendFriendsOnlineIfNeeded(IClientAPI client);