From 1842388bb4dcf5ecd57732ffa877b6ca1a3dec7b Mon Sep 17 00:00:00 2001 From: BlueWall Date: Fri, 6 Dec 2013 02:52:13 -0500 Subject: Add support for user preferences (im via email) --- OpenSim/Services/Interfaces/IUserProfilesService.cs | 5 +++++ OpenSim/Services/UserProfilesService/UserProfilesService.cs | 12 ++++++++++++ 2 files changed, 17 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Interfaces/IUserProfilesService.cs b/OpenSim/Services/Interfaces/IUserProfilesService.cs index 319d307..121baa8 100644 --- a/OpenSim/Services/Interfaces/IUserProfilesService.cs +++ b/OpenSim/Services/Interfaces/IUserProfilesService.cs @@ -57,6 +57,11 @@ namespace OpenSim.Services.Interfaces bool AvatarPropertiesRequest(ref UserProfileProperties prop, ref string result); bool AvatarPropertiesUpdate(ref UserProfileProperties prop, ref string result); #endregion Profile Properties + + #region User Preferences + bool UserPreferencesRequest(ref UserPreferences pref, ref string result); + bool UserPreferencesUpdate(ref UserPreferences pref, ref string result); + #endregion User Preferences #region Interests bool AvatarInterestsUpdate(UserProfileProperties prop, ref string result); diff --git a/OpenSim/Services/UserProfilesService/UserProfilesService.cs b/OpenSim/Services/UserProfilesService/UserProfilesService.cs index d00f34d..69c7b91 100644 --- a/OpenSim/Services/UserProfilesService/UserProfilesService.cs +++ b/OpenSim/Services/UserProfilesService/UserProfilesService.cs @@ -163,6 +163,18 @@ namespace OpenSim.Services.ProfilesService } #endregion Interests + #region User Preferences + public bool UserPreferencesUpdate(ref UserPreferences pref, ref string result) + { + return ProfilesData.UpdateUserPreferences(ref pref, ref result); + } + + public bool UserPreferencesRequest(ref UserPreferences pref, ref string result) + { + return ProfilesData.GetUserPreferences(ref pref, ref result); + } + #endregion User Preferences + #region Utility public OSD AvatarImageAssetsRequest(UUID avatarId) { -- cgit v1.1 From 4058e5f709990cc502d5479fb4065bf232ee3a8d Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 6 Dec 2013 16:01:29 -0800 Subject: Fixed misleading comment --- OpenSim/Services/Interfaces/IHypergridServices.cs | 3 --- 1 file changed, 3 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Interfaces/IHypergridServices.cs b/OpenSim/Services/Interfaces/IHypergridServices.cs index f9e7f08..05e175a 100644 --- a/OpenSim/Services/Interfaces/IHypergridServices.cs +++ b/OpenSim/Services/Interfaces/IHypergridServices.cs @@ -43,9 +43,6 @@ namespace OpenSim.Services.Interfaces } - /// - /// HG1.5 only - /// public interface IUserAgentService { bool LoginAgentToGrid(AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, bool fromLogin, out string reason); -- cgit v1.1 From b03ec6137f462486a3469f6ba4bbd363dc85295f Mon Sep 17 00:00:00 2001 From: BlueWall Date: Mon, 16 Dec 2013 15:10:09 -0500 Subject: Populate user preferences with UserAccount email if it is present, else return an error indicating no email is on record for the user. --- .../UserProfilesService/UserProfilesService.cs | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/UserProfilesService/UserProfilesService.cs b/OpenSim/Services/UserProfilesService/UserProfilesService.cs index 69c7b91..dd26cdc 100644 --- a/OpenSim/Services/UserProfilesService/UserProfilesService.cs +++ b/OpenSim/Services/UserProfilesService/UserProfilesService.cs @@ -37,6 +37,7 @@ using OpenSim.Data; using OpenMetaverse; using OpenMetaverse.StructuredData; using OpenSim.Framework; +using OpenSim.Services.UserAccountService; namespace OpenSim.Services.ProfilesService { @@ -166,11 +167,71 @@ namespace OpenSim.Services.ProfilesService #region User Preferences public bool UserPreferencesUpdate(ref UserPreferences pref, ref string result) { + if(string.IsNullOrEmpty(pref.EMail)) + { + UserAccount account = new UserAccount(); + if(userAccounts is UserAccountService.UserAccountService) + { + try + { + account = userAccounts.GetUserAccount(UUID.Zero, pref.UserId); + if(string.IsNullOrEmpty(account.Email)) + { + result = "No Email address on record!"; + return false; + } + else + pref.EMail = account.Email; + } + catch + { + m_log.Info ("[PROFILES]: UserAccountService Exception: Could not get user account"); + result = "Missing Email address!"; + return false; + } + } + else + { + m_log.Info ("[PROFILES]: UserAccountService: Could not get user account"); + result = "Missing Email address!"; + return false; + } + } return ProfilesData.UpdateUserPreferences(ref pref, ref result); } public bool UserPreferencesRequest(ref UserPreferences pref, ref string result) { + if(string.IsNullOrEmpty(pref.EMail)) + { + UserAccount account = new UserAccount(); + if(userAccounts is UserAccountService.UserAccountService) + { + try + { + account = userAccounts.GetUserAccount(UUID.Zero, pref.UserId); + if(string.IsNullOrEmpty(account.Email)) + { + result = "No Email address on record!"; + return false; + } + else + pref.EMail = account.Email; + } + catch + { + m_log.Info ("[PROFILES]: UserAccountService Exception: Could not get user account"); + result = "Missing Email address!"; + return false; + } + } + else + { + m_log.Info ("[PROFILES]: UserAccountService: Could not get user account"); + result = "Missing Email address!"; + return false; + } + } return ProfilesData.GetUserPreferences(ref pref, ref result); } #endregion User Preferences -- cgit v1.1