mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 10:15:33 +08:00
* Add the ability to update profiles via the cache, so that cached profiles don't become stale
* Add corresponding unit test
This commit is contained in:
@@ -168,6 +168,29 @@ namespace OpenSim.Framework.Communications.Cache
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update an existing profile
|
||||
/// </summary>
|
||||
/// <param name="userProfile"></param>
|
||||
/// <returns>true if a user profile was found to update, false otherwise</returns>
|
||||
public bool UpdateProfile(UserProfileData userProfile)
|
||||
{
|
||||
lock (m_userProfilesById)
|
||||
{
|
||||
CachedUserInfo userInfo = GetUserDetails(userProfile.ID);
|
||||
|
||||
if (userInfo != null)
|
||||
{
|
||||
userInfo.m_userProfile = userProfile;
|
||||
m_commsManager.UserService.UpdateUserProfile(userProfile);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Populate caches with the given user profile
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user