From 958a8f274b8a25703935ab4092f190e9d54b8559 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 7 Dec 2013 01:29:15 +0000 Subject: Revert "Add support for user preferences (im via email)" This reverts commit 1842388bb4dcf5ecd57732ffa877b6ca1a3dec7b. --- OpenSim/Data/PGSQL/PGSQLUserProfilesData.cs | 29 +++++++++++----------- .../Data/PGSQL/Resources/UserProfiles.migrations | 9 ------- 2 files changed, 15 insertions(+), 23 deletions(-) (limited to 'OpenSim/Data/PGSQL') 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 } #region User Preferences - public bool GetUserPreferences(ref UserPreferences pref, ref string result) + public OSDArray GetUserPreferences(UUID avatarId) { string query = string.Empty; @@ -891,16 +891,19 @@ namespace OpenSim.Data.PGSQL dbcon.Open(); using (NpgsqlCommand cmd = new NpgsqlCommand(query, dbcon)) { - cmd.Parameters.AddWithValue("Id", pref.UserId.ToString()); + cmd.Parameters.AddWithValue("Id", avatarId.ToString()); using (NpgsqlDataReader reader = cmd.ExecuteReader()) { if(reader.HasRows) { reader.Read(); - bool.TryParse((string)reader["imviaemail"], out pref.IMViaEmail); - bool.TryParse((string)reader["visible"], out pref.Visible); - pref.EMail = (string)reader["email"]; + OSDMap record = new OSDMap(); + + record.Add("imviaemail",OSD.FromString((string)reader["imviaemail"])); + record.Add("visible",OSD.FromString((string)reader["visible"])); + record.Add("email",OSD.FromString((string)reader["email"])); + data.Add(record); } else { @@ -923,16 +926,15 @@ namespace OpenSim.Data.PGSQL { m_log.DebugFormat("[PROFILES_DATA]" + ": Get preferences exception {0}", e.Message); - result = e.Message; } - return true; + return data; } - - public bool UpdateUserPreferences(ref UserPreferences pref, ref string result) + + public bool UpdateUserPreferences(bool emailIm, bool visible, UUID avatarId ) { string query = string.Empty; - query += "UPDATE usersettings SET "; + query += "UPDATE userpsettings SET "; query += "imviaemail=:ImViaEmail, "; query += "visible=:Visible,"; query += "WHERE useruuid=:uuid"; @@ -944,9 +946,9 @@ namespace OpenSim.Data.PGSQL dbcon.Open(); using (NpgsqlCommand cmd = new NpgsqlCommand(query, dbcon)) { - cmd.Parameters.AddWithValue("ImViaEmail", pref.IMViaEmail.ToString().ToLower ()); - cmd.Parameters.AddWithValue("Visible", pref.Visible.ToString().ToLower ()); - cmd.Parameters.AddWithValue("uuid", pref.UserId.ToString()); + cmd.Parameters.AddWithValue("ImViaEmail", emailIm.ToString().ToLower ()); + cmd.Parameters.AddWithValue("WantText", visible.ToString().ToLower ()); + cmd.Parameters.AddWithValue("uuid", avatarId.ToString()); lock(Lock) { @@ -959,7 +961,6 @@ namespace OpenSim.Data.PGSQL { m_log.DebugFormat("[PROFILES_DATA]" + ": AgentInterestsUpdate exception {0}", e.Message); - result = e.Message; return false; } 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 ( commit; -:VERSION 3 # ------------------------------- -begin; -CREATE TABLE usersettings ( - "useruuid" char(36) NOT NULL, - "imviaemail" bytea NOT NULL, - "visible" bytea NOT NULL, - PRIMARY KEY ("useruuid") -); -commit; \ No newline at end of file -- cgit v1.1