From abf1836b818e7876c3e32856b61cb1ba1f6460f2 Mon Sep 17 00:00:00 2001 From: AliciaRaven Date: Wed, 21 Jan 2015 00:42:46 +0000 Subject: Fix OfflineIMEmail value overwriting every time its called. The request was receiving a blank user prefs object to populate but then was checking for an email address. When this failed the email address was pulled from the User Account service and the empty prefs now including the email was saved before being loaded again to be returned. This was overwriting all other settings in the prefs. This fix returns the existing prefs first before checking the email address is set, and only updates email if missing. --- OpenSim/Services/UserProfilesService/UserProfilesService.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Services/UserProfilesService/UserProfilesService.cs b/OpenSim/Services/UserProfilesService/UserProfilesService.cs index 75101ff..96c13c0 100644 --- a/OpenSim/Services/UserProfilesService/UserProfilesService.cs +++ b/OpenSim/Services/UserProfilesService/UserProfilesService.cs @@ -196,6 +196,9 @@ namespace OpenSim.Services.ProfilesService public bool UserPreferencesRequest(ref UserPreferences pref, ref string result) { + if (!ProfilesData.GetUserPreferences(ref pref, ref result)) + return false; + if(string.IsNullOrEmpty(pref.EMail)) { UserAccount account = new UserAccount(); @@ -228,9 +231,6 @@ namespace OpenSim.Services.ProfilesService return false; } } - if (!ProfilesData.GetUserPreferences (ref pref, ref result)) - return false; - if(string.IsNullOrEmpty(pref.EMail)) pref.EMail = "No Email Address On Record"; -- cgit v1.1