aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2013-12-07 01:29:15 +0000
committerMelanie2013-12-07 01:29:15 +0000
commit958a8f274b8a25703935ab4092f190e9d54b8559 (patch)
treef2c8e71418c4cc1ceab11aa9ec217df929474b89
parentMerge branch 'master' into careminster (diff)
downloadopensim-SC_OLD-958a8f274b8a25703935ab4092f190e9d54b8559.zip
opensim-SC_OLD-958a8f274b8a25703935ab4092f190e9d54b8559.tar.gz
opensim-SC_OLD-958a8f274b8a25703935ab4092f190e9d54b8559.tar.bz2
opensim-SC_OLD-958a8f274b8a25703935ab4092f190e9d54b8559.tar.xz
Revert "Add support for user preferences (im via email)"
This reverts commit 1842388bb4dcf5ecd57732ffa877b6ca1a3dec7b.
-rw-r--r--OpenSim/Data/IProfilesData.cs2
-rw-r--r--OpenSim/Data/MySQL/MySQLUserProfilesData.cs39
-rw-r--r--OpenSim/Data/MySQL/Resources/UserProfiles.migrations10
-rw-r--r--OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs29
-rw-r--r--OpenSim/Data/PGSQL/Resources/UserProfiles.migrations9
-rw-r--r--OpenSim/Data/SQLite/Resources/UserProfiles.migrations12
-rw-r--r--OpenSim/Data/SQLite/SQLiteUserProfilesData.cs83
-rw-r--r--OpenSim/Framework/UserProfiles.cs8
-rw-r--r--OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs67
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/UserProfiles/LocalUserProfilesServiceConnector.cs2
-rw-r--r--OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs2
-rw-r--r--OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs53
-rw-r--r--OpenSim/Services/Interfaces/IUserProfilesService.cs5
-rw-r--r--OpenSim/Services/UserProfilesService/UserProfilesService.cs12
14 files changed, 36 insertions, 297 deletions
diff --git a/OpenSim/Data/IProfilesData.cs b/OpenSim/Data/IProfilesData.cs
index 7fb075d..0de7f68 100644
--- a/OpenSim/Data/IProfilesData.cs
+++ b/OpenSim/Data/IProfilesData.cs
@@ -48,8 +48,6 @@ namespace OpenSim.Data
48 bool UpdateAvatarProperties(ref UserProfileProperties props, ref string result); 48 bool UpdateAvatarProperties(ref UserProfileProperties props, ref string result);
49 bool UpdateAvatarInterests(UserProfileProperties up, ref string result); 49 bool UpdateAvatarInterests(UserProfileProperties up, ref string result);
50 bool GetClassifiedInfo(ref UserClassifiedAdd ad, ref string result); 50 bool GetClassifiedInfo(ref UserClassifiedAdd ad, ref string result);
51 bool UpdateUserPreferences(ref UserPreferences pref, ref string result);
52 bool GetUserPreferences(ref UserPreferences pref, ref string result);
53 bool GetUserAppData(ref UserAppData props, ref string result); 51 bool GetUserAppData(ref UserAppData props, ref string result);
54 bool SetUserAppData(UserAppData props, ref string result); 52 bool SetUserAppData(UserAppData props, ref string result);
55 OSDArray GetUserImageAssets(UUID avatarId); 53 OSDArray GetUserImageAssets(UUID avatarId);
diff --git a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs
index 63492c2..dc88f94 100644
--- a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs
@@ -895,7 +895,7 @@ namespace OpenSim.Data.MySQL
895 } 895 }
896 896
897 #region User Preferences 897 #region User Preferences
898 public bool GetUserPreferences(ref UserPreferences pref, ref string result) 898 public OSDArray GetUserPreferences(UUID avatarId)
899 { 899 {
900 string query = string.Empty; 900 string query = string.Empty;
901 901
@@ -912,16 +912,19 @@ namespace OpenSim.Data.MySQL
912 dbcon.Open(); 912 dbcon.Open();
913 using (MySqlCommand cmd = new MySqlCommand(query, dbcon)) 913 using (MySqlCommand cmd = new MySqlCommand(query, dbcon))
914 { 914 {
915 cmd.Parameters.AddWithValue("?Id", pref.UserId.ToString()); 915 cmd.Parameters.AddWithValue("?Id", avatarId.ToString());
916 916
917 using (MySqlDataReader reader = cmd.ExecuteReader()) 917 using (MySqlDataReader reader = cmd.ExecuteReader())
918 { 918 {
919 if(reader.HasRows) 919 if(reader.HasRows)
920 { 920 {
921 reader.Read(); 921 reader.Read();
922 bool.TryParse((string)reader["imviaemail"], out pref.IMViaEmail); 922 OSDMap record = new OSDMap();
923 bool.TryParse((string)reader["visible"], out pref.Visible); 923
924 pref.EMail = (string)reader["email"]; 924 record.Add("imviaemail",OSD.FromString((string)reader["imviaemail"]));
925 record.Add("visible",OSD.FromString((string)reader["visible"]));
926 record.Add("email",OSD.FromString((string)reader["email"]));
927 data.Add(record);
925 } 928 }
926 else 929 else
927 { 930 {
@@ -944,19 +947,17 @@ namespace OpenSim.Data.MySQL
944 { 947 {
945 m_log.DebugFormat("[PROFILES_DATA]" + 948 m_log.DebugFormat("[PROFILES_DATA]" +
946 ": Get preferences exception {0}", e.Message); 949 ": Get preferences exception {0}", e.Message);
947 result = e.Message;
948 return false;
949 } 950 }
950 return true; 951 return data;
951 } 952 }
952 953
953 public bool UpdateUserPreferences(ref UserPreferences pref, ref string result) 954 public bool UpdateUserPreferences(bool emailIm, bool visible, UUID avatarId )
954 { 955 {
955 string query = string.Empty; 956 string query = string.Empty;
956 957
957 query += "UPDATE usersettings SET "; 958 query += "UPDATE userpsettings SET ";
958 query += "imviaemail=?ImViaEmail, "; 959 query += "imviaemail=?ImViaEmail, ";
959 query += "visible=?Visible "; 960 query += "visible=?Visible,";
960 query += "WHERE useruuid=?uuid"; 961 query += "WHERE useruuid=?uuid";
961 962
962 try 963 try
@@ -966,11 +967,14 @@ namespace OpenSim.Data.MySQL
966 dbcon.Open(); 967 dbcon.Open();
967 using (MySqlCommand cmd = new MySqlCommand(query, dbcon)) 968 using (MySqlCommand cmd = new MySqlCommand(query, dbcon))
968 { 969 {
969 cmd.Parameters.AddWithValue("?ImViaEmail", pref.IMViaEmail); 970 cmd.Parameters.AddWithValue("?ImViaEmail", emailIm.ToString().ToLower ());
970 cmd.Parameters.AddWithValue("?Visible", pref.Visible); 971 cmd.Parameters.AddWithValue("?WantText", visible.ToString().ToLower ());
971 cmd.Parameters.AddWithValue("?uuid", pref.UserId.ToString()); 972 cmd.Parameters.AddWithValue("?uuid", avatarId.ToString());
972 973
973 cmd.ExecuteNonQuery(); 974 lock(Lock)
975 {
976 cmd.ExecuteNonQuery();
977 }
974 } 978 }
975 } 979 }
976 } 980 }
@@ -978,7 +982,6 @@ namespace OpenSim.Data.MySQL
978 { 982 {
979 m_log.DebugFormat("[PROFILES_DATA]" + 983 m_log.DebugFormat("[PROFILES_DATA]" +
980 ": AgentInterestsUpdate exception {0}", e.Message); 984 ": AgentInterestsUpdate exception {0}", e.Message);
981 result = e.Message;
982 return false; 985 return false;
983 } 986 }
984 return true; 987 return true;
diff --git a/OpenSim/Data/MySQL/Resources/UserProfiles.migrations b/OpenSim/Data/MySQL/Resources/UserProfiles.migrations
index bd325da..c29f1ab 100644
--- a/OpenSim/Data/MySQL/Resources/UserProfiles.migrations
+++ b/OpenSim/Data/MySQL/Resources/UserProfiles.migrations
@@ -81,13 +81,3 @@ CREATE TABLE IF NOT EXISTS `userdata` (
81 81
82commit; 82commit;
83 83
84:VERSION 3 # -------------------------------
85begin;
86CREATE TABLE IF NOT EXISTS `usersettings` (
87 `useruuid` varchar(36) NOT NULL,
88 `imviaemail` enum('true','false') NOT NULL,
89 `visible` enum('true','false') NOT NULL,
90 `email` varchar(254) NOT NULL,
91 PRIMARY KEY (`useruuid`)
92) ENGINE=MyISAM DEFAULT CHARSET=latin1;
93commit; \ No newline at end of file
diff --git a/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs b/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs
index 46f57d8..f4e41b4 100644
--- a/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs
+++ b/OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs
@@ -874,7 +874,7 @@ namespace OpenSim.Data.PGSQL
874 } 874 }
875 875
876 #region User Preferences 876 #region User Preferences
877 public bool GetUserPreferences(ref UserPreferences pref, ref string result) 877 public OSDArray GetUserPreferences(UUID avatarId)
878 { 878 {
879 string query = string.Empty; 879 string query = string.Empty;
880 880
@@ -891,16 +891,19 @@ namespace OpenSim.Data.PGSQL
891 dbcon.Open(); 891 dbcon.Open();
892 using (NpgsqlCommand cmd = new NpgsqlCommand(query, dbcon)) 892 using (NpgsqlCommand cmd = new NpgsqlCommand(query, dbcon))
893 { 893 {
894 cmd.Parameters.AddWithValue("Id", pref.UserId.ToString()); 894 cmd.Parameters.AddWithValue("Id", avatarId.ToString());
895 895
896 using (NpgsqlDataReader reader = cmd.ExecuteReader()) 896 using (NpgsqlDataReader reader = cmd.ExecuteReader())
897 { 897 {
898 if(reader.HasRows) 898 if(reader.HasRows)
899 { 899 {
900 reader.Read(); 900 reader.Read();
901 bool.TryParse((string)reader["imviaemail"], out pref.IMViaEmail); 901 OSDMap record = new OSDMap();
902 bool.TryParse((string)reader["visible"], out pref.Visible); 902
903 pref.EMail = (string)reader["email"]; 903 record.Add("imviaemail",OSD.FromString((string)reader["imviaemail"]));
904 record.Add("visible",OSD.FromString((string)reader["visible"]));
905 record.Add("email",OSD.FromString((string)reader["email"]));
906 data.Add(record);
904 } 907 }
905 else 908 else
906 { 909 {
@@ -923,16 +926,15 @@ namespace OpenSim.Data.PGSQL
923 { 926 {
924 m_log.DebugFormat("[PROFILES_DATA]" + 927 m_log.DebugFormat("[PROFILES_DATA]" +
925 ": Get preferences exception {0}", e.Message); 928 ": Get preferences exception {0}", e.Message);
926 result = e.Message;
927 } 929 }
928 return true; 930 return data;
929 } 931 }
930 932
931 public bool UpdateUserPreferences(ref UserPreferences pref, ref string result) 933 public bool UpdateUserPreferences(bool emailIm, bool visible, UUID avatarId )
932 { 934 {
933 string query = string.Empty; 935 string query = string.Empty;
934 936
935 query += "UPDATE usersettings SET "; 937 query += "UPDATE userpsettings SET ";
936 query += "imviaemail=:ImViaEmail, "; 938 query += "imviaemail=:ImViaEmail, ";
937 query += "visible=:Visible,"; 939 query += "visible=:Visible,";
938 query += "WHERE useruuid=:uuid"; 940 query += "WHERE useruuid=:uuid";
@@ -944,9 +946,9 @@ namespace OpenSim.Data.PGSQL
944 dbcon.Open(); 946 dbcon.Open();
945 using (NpgsqlCommand cmd = new NpgsqlCommand(query, dbcon)) 947 using (NpgsqlCommand cmd = new NpgsqlCommand(query, dbcon))
946 { 948 {
947 cmd.Parameters.AddWithValue("ImViaEmail", pref.IMViaEmail.ToString().ToLower ()); 949 cmd.Parameters.AddWithValue("ImViaEmail", emailIm.ToString().ToLower ());
948 cmd.Parameters.AddWithValue("Visible", pref.Visible.ToString().ToLower ()); 950 cmd.Parameters.AddWithValue("WantText", visible.ToString().ToLower ());
949 cmd.Parameters.AddWithValue("uuid", pref.UserId.ToString()); 951 cmd.Parameters.AddWithValue("uuid", avatarId.ToString());
950 952
951 lock(Lock) 953 lock(Lock)
952 { 954 {
@@ -959,7 +961,6 @@ namespace OpenSim.Data.PGSQL
959 { 961 {
960 m_log.DebugFormat("[PROFILES_DATA]" + 962 m_log.DebugFormat("[PROFILES_DATA]" +
961 ": AgentInterestsUpdate exception {0}", e.Message); 963 ": AgentInterestsUpdate exception {0}", e.Message);
962 result = e.Message;
963 return false; 964 return false;
964 } 965 }
965 return true; 966 return true;
diff --git a/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations b/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations
index 4fcaa8e..f23c870 100644
--- a/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations
+++ b/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations
@@ -81,12 +81,3 @@ CREATE TABLE userdata (
81 81
82commit; 82commit;
83 83
84:VERSION 3 # -------------------------------
85begin;
86CREATE TABLE usersettings (
87 "useruuid" char(36) NOT NULL,
88 "imviaemail" bytea NOT NULL,
89 "visible" bytea NOT NULL,
90 PRIMARY KEY ("useruuid")
91);
92commit; \ No newline at end of file
diff --git a/OpenSim/Data/SQLite/Resources/UserProfiles.migrations b/OpenSim/Data/SQLite/Resources/UserProfiles.migrations
index 86434e8..16581f6 100644
--- a/OpenSim/Data/SQLite/Resources/UserProfiles.migrations
+++ b/OpenSim/Data/SQLite/Resources/UserProfiles.migrations
@@ -88,15 +88,3 @@ CREATE TABLE IF NOT EXISTS userdata (
88 88
89commit; 89commit;
90 90
91
92:VERSION 3 # -------------------------------
93
94begin;
95CREATE TABLE IF NOT EXISTS usersettings (
96 useruuid char(36) NOT NULL,
97 imviaemail binary(1) NOT NULL,
98 visible binary(1) NOT NULL,
99 email varchar(254) NOT NULL,
100 PRIMARY KEY (useruuid)
101)
102commit; \ No newline at end of file
diff --git a/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs b/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs
index 916a226..8c1bcd4 100644
--- a/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs
+++ b/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs
@@ -747,89 +747,6 @@ namespace OpenSim.Data.SQLite
747 } 747 }
748 return true; 748 return true;
749 } 749 }
750
751 public bool UpdateUserPreferences(ref UserPreferences pref, ref string result)
752 {
753 string query = string.Empty;
754
755 query += "UPDATE usersettings SET ";
756 query += "imviaemail=:ImViaEmail, ";
757 query += "visible=:Visible ";
758 query += "WHERE useruuid=:uuid";
759
760 try
761 {
762 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
763 {
764 cmd.CommandText = query;
765 cmd.Parameters.AddWithValue(":ImViaEmail", pref.IMViaEmail);
766 cmd.Parameters.AddWithValue(":Visible", pref.Visible);
767 cmd.Parameters.AddWithValue(":uuid", pref.UserId.ToString());
768
769 cmd.ExecuteNonQuery();
770 }
771 }
772 catch (Exception e)
773 {
774 m_log.DebugFormat("[PROFILES_DATA]" +
775 ": AgentInterestsUpdate exception {0}", e.Message);
776 result = e.Message;
777 return false;
778 }
779 return true;
780 }
781
782 public bool GetUserPreferences(ref UserPreferences pref, ref string result)
783 {
784 IDataReader reader = null;
785 string query = string.Empty;
786
787 query += "SELECT imviaemail,visible,email FROM ";
788 query += "usersettings WHERE ";
789 query += "useruuid = :Id";
790
791 OSDArray data = new OSDArray();
792
793 try
794 {
795 using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
796 {
797 cmd.CommandText = query;
798 cmd.Parameters.AddWithValue("?Id", pref.UserId.ToString());
799
800 using (reader = cmd.ExecuteReader(CommandBehavior.SingleRow))
801 {
802 if(reader.Read())
803 {
804 bool.TryParse((string)reader["imviaemail"], out pref.IMViaEmail);
805 bool.TryParse((string)reader["visible"], out pref.Visible);
806 pref.EMail = (string)reader["email"];
807 }
808 else
809 {
810 query = "INSERT INTO usersettings VALUES ";
811 query += "(:Id,'false','false', '')";
812
813 using (SqliteCommand put = (SqliteCommand)m_connection.CreateCommand())
814 {
815 put.Parameters.AddWithValue(":Id", pref.UserId.ToString());
816 put.ExecuteNonQuery();
817
818 }
819 }
820 }
821 }
822 }
823 catch (Exception e)
824 {
825 m_log.DebugFormat("[PROFILES_DATA]" +
826 ": Get preferences exception {0}", e.Message);
827 result = e.Message;
828 return false;
829 }
830 return true;
831 }
832
833 public bool GetUserAppData(ref UserAppData props, ref string result) 750 public bool GetUserAppData(ref UserAppData props, ref string result)
834 { 751 {
835 IDataReader reader = null; 752 IDataReader reader = null;
diff --git a/OpenSim/Framework/UserProfiles.cs b/OpenSim/Framework/UserProfiles.cs
index 492f6b9..6133591 100644
--- a/OpenSim/Framework/UserProfiles.cs
+++ b/OpenSim/Framework/UserProfiles.cs
@@ -90,14 +90,6 @@ namespace OpenSim.Framework
90 public UUID TargetId; 90 public UUID TargetId;
91 public string Notes; 91 public string Notes;
92 } 92 }
93
94 public class UserPreferences
95 {
96 public UUID UserId;
97 public bool IMViaEmail = false;
98 public bool Visible = false;
99 public string EMail = string.Empty;
100 }
101 93
102 public class UserAccountProperties 94 public class UserAccountProperties
103 { 95 {
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
index b21082f..56ff2bd 100644
--- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
@@ -270,10 +270,6 @@ 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;
277 } 273 }
278 #endregion Region Event Handlers 274 #endregion Region Event Handlers
279 275
@@ -803,69 +799,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
803 } 799 }
804 #endregion Notes 800 #endregion Notes
805 801
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
869 #region Avatar Properties 802 #region Avatar Properties
870 /// <summary> 803 /// <summary>
871 /// Update the avatars interests . 804 /// Update the avatars interests .
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/UserProfiles/LocalUserProfilesServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/UserProfiles/LocalUserProfilesServiceConnector.cs
index 4701ee6..323535a 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/UserProfiles/LocalUserProfilesServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/UserProfiles/LocalUserProfilesServiceConnector.cs
@@ -153,8 +153,6 @@ 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);
158 Server.AddJsonRPCHandler("image_assets_request", handler.AvatarImageAssetsRequest); 156 Server.AddJsonRPCHandler("image_assets_request", handler.AvatarImageAssetsRequest);
159 Server.AddJsonRPCHandler("user_data_request", handler.RequestUserAppData); 157 Server.AddJsonRPCHandler("user_data_request", handler.RequestUserAppData);
160 Server.AddJsonRPCHandler("user_data_update", handler.UpdateUserAppData); 158 Server.AddJsonRPCHandler("user_data_update", handler.UpdateUserAppData);
diff --git a/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs b/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
index 6403882..28dbbc2 100644
--- a/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
+++ b/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
@@ -104,8 +104,6 @@ namespace OpenSim.Server.Handlers.Profiles
104 Server.AddJsonRPCHandler("avatar_properties_request", handler.AvatarPropertiesRequest); 104 Server.AddJsonRPCHandler("avatar_properties_request", handler.AvatarPropertiesRequest);
105 Server.AddJsonRPCHandler("avatar_properties_update", handler.AvatarPropertiesUpdate); 105 Server.AddJsonRPCHandler("avatar_properties_update", handler.AvatarPropertiesUpdate);
106 Server.AddJsonRPCHandler("avatar_interests_update", handler.AvatarInterestsUpdate); 106 Server.AddJsonRPCHandler("avatar_interests_update", handler.AvatarInterestsUpdate);
107 Server.AddJsonRPCHandler("user_preferences_update", handler.UserPreferenecesUpdate);
108 Server.AddJsonRPCHandler("user_preferences_request", handler.UserPreferencesRequest);
109 Server.AddJsonRPCHandler("image_assets_request", handler.AvatarImageAssetsRequest); 107 Server.AddJsonRPCHandler("image_assets_request", handler.AvatarImageAssetsRequest);
110 Server.AddJsonRPCHandler("user_data_request", handler.RequestUserAppData); 108 Server.AddJsonRPCHandler("user_data_request", handler.RequestUserAppData);
111 Server.AddJsonRPCHandler("user_data_update", handler.UpdateUserAppData); 109 Server.AddJsonRPCHandler("user_data_update", handler.UpdateUserAppData);
diff --git a/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs b/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs
index d30cc22..f5f0794 100644
--- a/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs
+++ b/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs
@@ -381,59 +381,6 @@ 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
437 #region Utility 384 #region Utility
438 public bool AvatarImageAssetsRequest(OSDMap json, ref JsonRpcResponse response) 385 public bool AvatarImageAssetsRequest(OSDMap json, ref JsonRpcResponse response)
439 { 386 {
diff --git a/OpenSim/Services/Interfaces/IUserProfilesService.cs b/OpenSim/Services/Interfaces/IUserProfilesService.cs
index 121baa8..319d307 100644
--- a/OpenSim/Services/Interfaces/IUserProfilesService.cs
+++ b/OpenSim/Services/Interfaces/IUserProfilesService.cs
@@ -57,11 +57,6 @@ namespace OpenSim.Services.Interfaces
57 bool AvatarPropertiesRequest(ref UserProfileProperties prop, ref string result); 57 bool AvatarPropertiesRequest(ref UserProfileProperties prop, ref string result);
58 bool AvatarPropertiesUpdate(ref UserProfileProperties prop, ref string result); 58 bool AvatarPropertiesUpdate(ref UserProfileProperties prop, ref string result);
59 #endregion Profile Properties 59 #endregion Profile Properties
60
61 #region User Preferences
62 bool UserPreferencesRequest(ref UserPreferences pref, ref string result);
63 bool UserPreferencesUpdate(ref UserPreferences pref, ref string result);
64 #endregion User Preferences
65 60
66 #region Interests 61 #region Interests
67 bool AvatarInterestsUpdate(UserProfileProperties prop, ref string result); 62 bool AvatarInterestsUpdate(UserProfileProperties prop, ref string result);
diff --git a/OpenSim/Services/UserProfilesService/UserProfilesService.cs b/OpenSim/Services/UserProfilesService/UserProfilesService.cs
index 69c7b91..d00f34d 100644
--- a/OpenSim/Services/UserProfilesService/UserProfilesService.cs
+++ b/OpenSim/Services/UserProfilesService/UserProfilesService.cs
@@ -163,18 +163,6 @@ namespace OpenSim.Services.ProfilesService
163 } 163 }
164 #endregion Interests 164 #endregion Interests
165 165
166 #region User Preferences
167 public bool UserPreferencesUpdate(ref UserPreferences pref, ref string result)
168 {
169 return ProfilesData.UpdateUserPreferences(ref pref, ref result);
170 }
171
172 public bool UserPreferencesRequest(ref UserPreferences pref, ref string result)
173 {
174 return ProfilesData.GetUserPreferences(ref pref, ref result);
175 }
176 #endregion User Preferences
177
178 #region Utility 166 #region Utility
179 public OSD AvatarImageAssetsRequest(UUID avatarId) 167 public OSD AvatarImageAssetsRequest(UUID avatarId)
180 { 168 {