aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/UserProfiles
diff options
context:
space:
mode:
authorRobert Adams2013-12-17 06:18:13 -0800
committerRobert Adams2013-12-17 06:18:13 -0800
commit6937eec2588fab5e73c3ddc74c4ddc1bb35e7527 (patch)
tree4372b6dfa7f2e277312c0547a099f6ffeea6e91f /OpenSim/Region/CoreModules/Avatar/UserProfiles
parentvarregion: rename 'LegacyRegionLocX' back to 'RegionLocX' and same for Y and Z. (diff)
parentFix issue with editing notes for other avatars (diff)
downloadopensim-SC-6937eec2588fab5e73c3ddc74c4ddc1bb35e7527.zip
opensim-SC-6937eec2588fab5e73c3ddc74c4ddc1bb35e7527.tar.gz
opensim-SC-6937eec2588fab5e73c3ddc74c4ddc1bb35e7527.tar.bz2
opensim-SC-6937eec2588fab5e73c3ddc74c4ddc1bb35e7527.tar.xz
Merge branch 'master' into varregion
Add new region crossing code to varregion Conflicts: OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs OpenSim/Region/Framework/Scenes/ScenePresence.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/UserProfiles')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs71
1 files changed, 69 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
index 80dfa04..7e50cc6 100644
--- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
@@ -270,6 +270,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
270 // Notes 270 // Notes
271 client.AddGenericPacketHandler("avatarnotesrequest", NotesRequest); 271 client.AddGenericPacketHandler("avatarnotesrequest", NotesRequest);
272 client.OnAvatarNotesUpdate += NotesUpdate; 272 client.OnAvatarNotesUpdate += NotesUpdate;
273
274 // Preferences
275 client.OnUserInfoRequest += UserPreferencesRequest;
276 client.OnUpdateUserInfo += UpdateUserPreferences;
273 } 277 }
274 #endregion Region Event Handlers 278 #endregion Region Event Handlers
275 279
@@ -754,8 +758,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
754 IClientAPI remoteClient = (IClientAPI)sender; 758 IClientAPI remoteClient = (IClientAPI)sender;
755 string serverURI = string.Empty; 759 string serverURI = string.Empty;
756 GetUserProfileServerURI(remoteClient.AgentId, out serverURI); 760 GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
757 note.TargetId = remoteClient.AgentId; 761 note.UserId = remoteClient.AgentId;
758 UUID.TryParse(args[0], out note.UserId); 762 UUID.TryParse(args[0], out note.TargetId);
759 763
760 object Note = (object)note; 764 object Note = (object)note;
761 if(!JsonRpcRequest(ref Note, "avatarnotesrequest", serverURI, UUID.Random().ToString())) 765 if(!JsonRpcRequest(ref Note, "avatarnotesrequest", serverURI, UUID.Random().ToString()))
@@ -799,6 +803,69 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
799 } 803 }
800 #endregion Notes 804 #endregion Notes
801 805
806 #region User Preferences
807 /// <summary>
808 /// Updates the user preferences.
809 /// </summary>
810 /// <param name='imViaEmail'>
811 /// Im via email.
812 /// </param>
813 /// <param name='visible'>
814 /// Visible.
815 /// </param>
816 /// <param name='remoteClient'>
817 /// Remote client.
818 /// </param>
819 public void UpdateUserPreferences(bool imViaEmail, bool visible, IClientAPI remoteClient)
820 {
821 UserPreferences pref = new UserPreferences();
822
823 pref.UserId = remoteClient.AgentId;
824 pref.IMViaEmail = imViaEmail;
825 pref.Visible = visible;
826
827 string serverURI = string.Empty;
828 bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
829
830 object Pref = pref;
831 if(!JsonRpcRequest(ref Pref, "user_preferences_update", serverURI, UUID.Random().ToString()))
832 {
833 m_log.InfoFormat("[PROFILES]: UserPreferences update error");
834 remoteClient.SendAgentAlertMessage("Error updating preferences", false);
835 return;
836 }
837 }
838
839 /// <summary>
840 /// Users the preferences request.
841 /// </summary>
842 /// <param name='remoteClient'>
843 /// Remote client.
844 /// </param>
845 public void UserPreferencesRequest(IClientAPI remoteClient)
846 {
847 UserPreferences pref = new UserPreferences();
848
849 pref.UserId = remoteClient.AgentId;
850
851 string serverURI = string.Empty;
852 bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
853
854
855 object Pref = (object)pref;
856 if(!JsonRpcRequest(ref Pref, "user_preferences_request", serverURI, UUID.Random().ToString()))
857 {
858 m_log.InfoFormat("[PROFILES]: UserPreferences request error");
859 remoteClient.SendAgentAlertMessage("Error requesting preferences", false);
860 return;
861 }
862 pref = (UserPreferences) Pref;
863
864 remoteClient.SendUserInfoReply(pref.IMViaEmail, pref.Visible, pref.EMail);
865
866 }
867 #endregion User Preferences
868
802 #region Avatar Properties 869 #region Avatar Properties
803 /// <summary> 870 /// <summary>
804 /// Update the avatars interests . 871 /// Update the avatars interests .