aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs')
-rw-r--r--OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs53
1 files changed, 53 insertions, 0 deletions
diff --git a/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs b/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs
index f5f0794..d30cc22 100644
--- a/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs
+++ b/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs
@@ -381,6 +381,59 @@ namespace OpenSim.Server.Handlers
381 } 381 }
382 #endregion Interests 382 #endregion Interests
383 383
384 #region User Preferences
385 public bool UserPreferencesRequest(OSDMap json, ref JsonRpcResponse response)
386 {
387 if(!json.ContainsKey("params"))
388 {
389 response.Error.Code = ErrorCode.ParseError;
390 m_log.DebugFormat ("User Preferences Request");
391 return false;
392 }
393
394 string result = string.Empty;
395 UserPreferences prefs = new UserPreferences();
396 object Prefs = (object)prefs;
397 OSD.DeserializeMembers(ref Prefs, (OSDMap)json["params"]);
398 if(Service.UserPreferencesRequest(ref prefs, ref result))
399 {
400 response.Result = OSD.SerializeMembers(prefs);
401 return true;
402 }
403
404 response.Error.Code = ErrorCode.InternalError;
405 response.Error.Message = string.Format("{0}", result);
406 m_log.InfoFormat("[PROFILES]: User preferences request error - {0}", response.Error.Message);
407 return false;
408 }
409
410 public bool UserPreferenecesUpdate(OSDMap json, ref JsonRpcResponse response)
411 {
412 if(!json.ContainsKey("params"))
413 {
414 response.Error.Code = ErrorCode.ParseError;
415 response.Error.Message = "no parameters supplied";
416 m_log.DebugFormat ("User Preferences Update Request");
417 return false;
418 }
419
420 string result = string.Empty;
421 UserPreferences prefs = new UserPreferences();
422 object Prefs = (object)prefs;
423 OSD.DeserializeMembers(ref Prefs, (OSDMap)json["params"]);
424 if(Service.UserPreferencesUpdate(ref prefs, ref result))
425 {
426 response.Result = OSD.SerializeMembers(prefs);
427 return true;
428 }
429
430 response.Error.Code = ErrorCode.InternalError;
431 response.Error.Message = string.Format("{0}", result);
432 m_log.InfoFormat("[PROFILES]: User preferences update error - {0}", response.Error.Message);
433 return false;
434 }
435 #endregion User Preferences
436
384 #region Utility 437 #region Utility
385 public bool AvatarImageAssetsRequest(OSDMap json, ref JsonRpcResponse response) 438 public bool AvatarImageAssetsRequest(OSDMap json, ref JsonRpcResponse response)
386 { 439 {