diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs | 67 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsIn/UserProfiles/LocalUserProfilesServiceConnector.cs | 2 |
2 files changed, 69 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index 966a05c..697a73e 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 | ||
@@ -802,6 +806,69 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
802 | } | 806 | } |
803 | #endregion Notes | 807 | #endregion Notes |
804 | 808 | ||
809 | #region User Preferences | ||
810 | /// <summary> | ||
811 | /// Updates the user preferences. | ||
812 | /// </summary> | ||
813 | /// <param name='imViaEmail'> | ||
814 | /// Im via email. | ||
815 | /// </param> | ||
816 | /// <param name='visible'> | ||
817 | /// Visible. | ||
818 | /// </param> | ||
819 | /// <param name='remoteClient'> | ||
820 | /// Remote client. | ||
821 | /// </param> | ||
822 | public void UpdateUserPreferences(bool imViaEmail, bool visible, IClientAPI remoteClient) | ||
823 | { | ||
824 | UserPreferences pref = new UserPreferences(); | ||
825 | |||
826 | pref.UserId = remoteClient.AgentId; | ||
827 | pref.IMViaEmail = imViaEmail; | ||
828 | pref.Visible = visible; | ||
829 | |||
830 | string serverURI = string.Empty; | ||
831 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | ||
832 | |||
833 | object Pref = pref; | ||
834 | if(!JsonRpcRequest(ref Pref, "user_preferences_update", serverURI, UUID.Random().ToString())) | ||
835 | { | ||
836 | m_log.InfoFormat("[PROFILES]: UserPreferences update error"); | ||
837 | remoteClient.SendAgentAlertMessage("Error updating preferences", false); | ||
838 | return; | ||
839 | } | ||
840 | } | ||
841 | |||
842 | /// <summary> | ||
843 | /// Users the preferences request. | ||
844 | /// </summary> | ||
845 | /// <param name='remoteClient'> | ||
846 | /// Remote client. | ||
847 | /// </param> | ||
848 | public void UserPreferencesRequest(IClientAPI remoteClient) | ||
849 | { | ||
850 | UserPreferences pref = new UserPreferences(); | ||
851 | |||
852 | pref.UserId = remoteClient.AgentId; | ||
853 | |||
854 | string serverURI = string.Empty; | ||
855 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | ||
856 | |||
857 | |||
858 | object Pref = (object)pref; | ||
859 | if(!JsonRpcRequest(ref Pref, "user_preferences_request", serverURI, UUID.Random().ToString())) | ||
860 | { | ||
861 | m_log.InfoFormat("[PROFILES]: UserPreferences request error"); | ||
862 | remoteClient.SendAgentAlertMessage("Error requesting preferences", false); | ||
863 | return; | ||
864 | } | ||
865 | pref = (UserPreferences) Pref; | ||
866 | |||
867 | remoteClient.SendUserInfoReply(pref.IMViaEmail, pref.Visible, pref.EMail); | ||
868 | |||
869 | } | ||
870 | #endregion User Preferences | ||
871 | |||
805 | #region Avatar Properties | 872 | #region Avatar Properties |
806 | /// <summary> | 873 | /// <summary> |
807 | /// Update the avatars interests . | 874 | /// Update the avatars interests . |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/UserProfiles/LocalUserProfilesServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/UserProfiles/LocalUserProfilesServiceConnector.cs index 323535a..4701ee6 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/UserProfiles/LocalUserProfilesServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/UserProfiles/LocalUserProfilesServiceConnector.cs | |||
@@ -153,6 +153,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Profile | |||
153 | Server.AddJsonRPCHandler("avatar_properties_request", handler.AvatarPropertiesRequest); | 153 | Server.AddJsonRPCHandler("avatar_properties_request", handler.AvatarPropertiesRequest); |
154 | Server.AddJsonRPCHandler("avatar_properties_update", handler.AvatarPropertiesUpdate); | 154 | Server.AddJsonRPCHandler("avatar_properties_update", handler.AvatarPropertiesUpdate); |
155 | Server.AddJsonRPCHandler("avatar_interests_update", handler.AvatarInterestsUpdate); | 155 | Server.AddJsonRPCHandler("avatar_interests_update", handler.AvatarInterestsUpdate); |
156 | Server.AddJsonRPCHandler("user_preferences_update", handler.UserPreferenecesUpdate); | ||
157 | Server.AddJsonRPCHandler("user_preferences_request", handler.UserPreferencesRequest); | ||
156 | Server.AddJsonRPCHandler("image_assets_request", handler.AvatarImageAssetsRequest); | 158 | Server.AddJsonRPCHandler("image_assets_request", handler.AvatarImageAssetsRequest); |
157 | Server.AddJsonRPCHandler("user_data_request", handler.RequestUserAppData); | 159 | Server.AddJsonRPCHandler("user_data_request", handler.RequestUserAppData); |
158 | Server.AddJsonRPCHandler("user_data_update", handler.UpdateUserAppData); | 160 | Server.AddJsonRPCHandler("user_data_update", handler.UpdateUserAppData); |