From 59157d9d63c0e038ca0a619bfae1be3ed6f77677 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 30 Mar 2012 00:40:19 +0100 Subject: Add simple login test with online friends. Add IFriendsModule.GrantRights() for granting rights via a module call. Rename IFriendsModule.GetFriendPerms() -> GetRightsGrantedByFriend() to be more self-documenting and consistent with friends module terminology. Add some method doc. --- .../Region/Framework/Interfaces/IFriendsModule.cs | 24 ++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Interfaces/IFriendsModule.cs') diff --git a/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs b/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs index 061799e..10bef1e 100644 --- a/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs @@ -55,7 +55,27 @@ namespace OpenSim.Region.Framework.Interfaces /// void RemoveFriendship(IClientAPI client, UUID exFriendID); - uint GetFriendPerms(UUID PrincipalID, UUID FriendID); + /// + /// Get permissions granted by a friend. + /// + /// The user. + /// The friend that granted. + /// The permissions. These come from the FriendRights enum. + int GetRightsGrantedByFriend(UUID PrincipalID, UUID FriendID); + + /// + /// Grant permissions for a friend. + /// + /// + /// This includes giving them the ability to see when the user is online and permission to edit the user's + /// objects. + /// Granting lower permissions than the friend currently has will rescind the extra permissions. + /// + /// The user granting the permissions. + /// The friend. + /// These come from the FriendRights enum. + void GrantRights(IClientAPI remoteClient, UUID friendID, int perms); + bool SendFriendsOnlineIfNeeded(IClientAPI client); } -} +} \ No newline at end of file -- cgit v1.1 From bce7964ac2b0e67ff8c8e5ab00bb45b93da219ad Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 30 Mar 2012 01:05:29 +0100 Subject: refactor: Move "friends show cache" console command out into separate FriendsCommandsModule. Expose required methods on IFriendsModule. Rename GetFriends() -> GetFriendsFromCache() for self-documentation --- .../Region/Framework/Interfaces/IFriendsModule.cs | 25 ++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Framework/Interfaces/IFriendsModule.cs') diff --git a/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs b/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs index 10bef1e..7e87006 100644 --- a/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs @@ -25,15 +25,32 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System.Collections.Generic; using OpenMetaverse; using OpenSim.Framework; -using System.Collections.Generic; +using FriendInfo = OpenSim.Services.Interfaces.FriendInfo; namespace OpenSim.Region.Framework.Interfaces { public interface IFriendsModule { /// + /// Are friends cached on this simulator for a particular user? + /// + /// + /// + bool AreFriendsCached(UUID userID); + + /// + /// Get friends from local cache only + /// + /// + /// + /// An empty array if the user has no friends or friends have not been cached. + /// + FriendInfo[] GetFriendsFromCache(UUID userID); + + /// /// Add a friendship between two users. /// /// @@ -58,10 +75,10 @@ namespace OpenSim.Region.Framework.Interfaces /// /// Get permissions granted by a friend. /// - /// The user. - /// The friend that granted. + /// The user. + /// The friend that granted. /// The permissions. These come from the FriendRights enum. - int GetRightsGrantedByFriend(UUID PrincipalID, UUID FriendID); + int GetRightsGrantedByFriend(UUID userID, UUID friendID); /// /// Grant permissions for a friend. -- cgit v1.1