From 3180432debcd9078e8e838d4bbe3ddaf9cdfe110 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Mon, 31 Dec 2007 22:56:43 +0000 Subject: * Added database and UserManagerBase glue for FriendsList management * Don't forget to run prebuild --- .../Framework/Communications/UserManagerBase.cs | 74 ++++++++++++++++++++++ 1 file changed, 74 insertions(+) (limited to 'OpenSim/Framework/Communications/UserManagerBase.cs') diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index f913d2c..5d62e5e 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs @@ -197,6 +197,80 @@ namespace OpenSim.Framework.UserManagement } /// + /// Loads a user's friend list + /// + /// the UUID of the friend list owner + /// A List of FriendListItems that contains info about the user's friends + public List GetUserFriendList(LLUUID ownerID) + { + + foreach (KeyValuePair plugin in _plugins) + { + try + { + return plugin.Value.GetUserFriendList(ownerID); + } + catch (Exception e) + { + MainLog.Instance.Verbose("USERSTORAGE", + "Unable to GetUserFriendList via " + plugin.Key + "(" + e.ToString() + ")"); + } + } + + return null; + + } + + public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms) + { + foreach (KeyValuePair plugin in _plugins) + { + try + { + plugin.Value.AddNewUserFriend(friendlistowner,friend,perms); + } + catch (Exception e) + { + MainLog.Instance.Verbose("USERSTORAGE", + "Unable to AddNewUserFriend via " + plugin.Key + "(" + e.ToString() + ")"); + } + } + + } + + + public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend) + { + foreach (KeyValuePair plugin in _plugins) + { + try + { + plugin.Value.RemoveUserFriend(friendlistowner, friend); + } + catch (Exception e) + { + MainLog.Instance.Verbose("USERSTORAGE", + "Unable to RemoveUserFriend via " + plugin.Key + "(" + e.ToString() + ")"); + } + } + } + + public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms) + { + foreach (KeyValuePair plugin in _plugins) + { + try + { + plugin.Value.UpdateUserFriendPerms(friendlistowner, friend, perms); + } + catch (Exception e) + { + MainLog.Instance.Verbose("USERSTORAGE", + "Unable to UpdateUserFriendPerms via " + plugin.Key + "(" + e.ToString() + ")"); + } + } + } + /// /// Loads a user agent by name (not called directly) /// /// The agent's name -- cgit v1.1