diff options
4 files changed, 79 insertions, 9 deletions
diff --git a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs index dca80c3..13e0a57 100644 --- a/OpenSim/Data/MySQL/MySQLUserProfilesData.cs +++ b/OpenSim/Data/MySQL/MySQLUserProfilesData.cs | |||
@@ -546,6 +546,10 @@ namespace OpenSim.Data.MySQL | |||
546 | reader.Read(); | 546 | reader.Read(); |
547 | notes.Notes = OSD.FromString((string)reader["notes"]); | 547 | notes.Notes = OSD.FromString((string)reader["notes"]); |
548 | } | 548 | } |
549 | else | ||
550 | { | ||
551 | notes.Notes = OSD.FromString(""); | ||
552 | } | ||
549 | } | 553 | } |
550 | } | 554 | } |
551 | } | 555 | } |
@@ -927,15 +931,19 @@ namespace OpenSim.Data.MySQL | |||
927 | } | 931 | } |
928 | else | 932 | else |
929 | { | 933 | { |
934 | dbcon.Close(); | ||
935 | dbcon.Open(); | ||
936 | |||
937 | query = "INSERT INTO usersettings VALUES "; | ||
938 | query += "(?uuid,'false','false', ?Email)"; | ||
939 | |||
930 | using (MySqlCommand put = new MySqlCommand(query, dbcon)) | 940 | using (MySqlCommand put = new MySqlCommand(query, dbcon)) |
931 | { | 941 | { |
932 | query = "INSERT INTO usersettings VALUES "; | ||
933 | query += "(?Id,'false','false', '')"; | ||
934 | 942 | ||
935 | lock(Lock) | 943 | put.Parameters.AddWithValue("?Email", pref.EMail); |
936 | { | 944 | put.Parameters.AddWithValue("?uuid", pref.UserId.ToString()); |
937 | put.ExecuteNonQuery(); | 945 | |
938 | } | 946 | put.ExecuteNonQuery(); |
939 | } | 947 | } |
940 | } | 948 | } |
941 | } | 949 | } |
diff --git a/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs b/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs index 70ce07c..0a6c625 100644 --- a/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserProfilesData.cs | |||
@@ -810,11 +810,12 @@ namespace OpenSim.Data.SQLite | |||
810 | else | 810 | else |
811 | { | 811 | { |
812 | query = "INSERT INTO usersettings VALUES "; | 812 | query = "INSERT INTO usersettings VALUES "; |
813 | query += "(:Id,'false','false', '')"; | 813 | query += "(:Id,'false','false', :Email)"; |
814 | 814 | ||
815 | using (SqliteCommand put = (SqliteCommand)m_connection.CreateCommand()) | 815 | using (SqliteCommand put = (SqliteCommand)m_connection.CreateCommand()) |
816 | { | 816 | { |
817 | put.Parameters.AddWithValue(":Id", pref.UserId.ToString()); | 817 | put.Parameters.AddWithValue(":Id", pref.UserId.ToString()); |
818 | put.Parameters.AddWithValue(":Email", pref.EMail); | ||
818 | put.ExecuteNonQuery(); | 819 | put.ExecuteNonQuery(); |
819 | 820 | ||
820 | } | 821 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index 697a73e..e13bf4f 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs | |||
@@ -760,8 +760,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
760 | IClientAPI remoteClient = (IClientAPI)sender; | 760 | IClientAPI remoteClient = (IClientAPI)sender; |
761 | string serverURI = string.Empty; | 761 | string serverURI = string.Empty; |
762 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 762 | GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
763 | note.TargetId = remoteClient.AgentId; | 763 | note.UserId = remoteClient.AgentId; |
764 | UUID.TryParse(args[0], out note.UserId); | 764 | UUID.TryParse(args[0], out note.TargetId); |
765 | 765 | ||
766 | object Note = (object)note; | 766 | object Note = (object)note; |
767 | if(!JsonRpcRequest(ref Note, "avatarnotesrequest", serverURI, UUID.Random().ToString())) | 767 | if(!JsonRpcRequest(ref Note, "avatarnotesrequest", serverURI, UUID.Random().ToString())) |
diff --git a/OpenSim/Services/UserProfilesService/UserProfilesService.cs b/OpenSim/Services/UserProfilesService/UserProfilesService.cs index 69c7b91..dd26cdc 100644 --- a/OpenSim/Services/UserProfilesService/UserProfilesService.cs +++ b/OpenSim/Services/UserProfilesService/UserProfilesService.cs | |||
@@ -37,6 +37,7 @@ using OpenSim.Data; | |||
37 | using OpenMetaverse; | 37 | using OpenMetaverse; |
38 | using OpenMetaverse.StructuredData; | 38 | using OpenMetaverse.StructuredData; |
39 | using OpenSim.Framework; | 39 | using OpenSim.Framework; |
40 | using OpenSim.Services.UserAccountService; | ||
40 | 41 | ||
41 | namespace OpenSim.Services.ProfilesService | 42 | namespace OpenSim.Services.ProfilesService |
42 | { | 43 | { |
@@ -166,11 +167,71 @@ namespace OpenSim.Services.ProfilesService | |||
166 | #region User Preferences | 167 | #region User Preferences |
167 | public bool UserPreferencesUpdate(ref UserPreferences pref, ref string result) | 168 | public bool UserPreferencesUpdate(ref UserPreferences pref, ref string result) |
168 | { | 169 | { |
170 | if(string.IsNullOrEmpty(pref.EMail)) | ||
171 | { | ||
172 | UserAccount account = new UserAccount(); | ||
173 | if(userAccounts is UserAccountService.UserAccountService) | ||
174 | { | ||
175 | try | ||
176 | { | ||
177 | account = userAccounts.GetUserAccount(UUID.Zero, pref.UserId); | ||
178 | if(string.IsNullOrEmpty(account.Email)) | ||
179 | { | ||
180 | result = "No Email address on record!"; | ||
181 | return false; | ||
182 | } | ||
183 | else | ||
184 | pref.EMail = account.Email; | ||
185 | } | ||
186 | catch | ||
187 | { | ||
188 | m_log.Info ("[PROFILES]: UserAccountService Exception: Could not get user account"); | ||
189 | result = "Missing Email address!"; | ||
190 | return false; | ||
191 | } | ||
192 | } | ||
193 | else | ||
194 | { | ||
195 | m_log.Info ("[PROFILES]: UserAccountService: Could not get user account"); | ||
196 | result = "Missing Email address!"; | ||
197 | return false; | ||
198 | } | ||
199 | } | ||
169 | return ProfilesData.UpdateUserPreferences(ref pref, ref result); | 200 | return ProfilesData.UpdateUserPreferences(ref pref, ref result); |
170 | } | 201 | } |
171 | 202 | ||
172 | public bool UserPreferencesRequest(ref UserPreferences pref, ref string result) | 203 | public bool UserPreferencesRequest(ref UserPreferences pref, ref string result) |
173 | { | 204 | { |
205 | if(string.IsNullOrEmpty(pref.EMail)) | ||
206 | { | ||
207 | UserAccount account = new UserAccount(); | ||
208 | if(userAccounts is UserAccountService.UserAccountService) | ||
209 | { | ||
210 | try | ||
211 | { | ||
212 | account = userAccounts.GetUserAccount(UUID.Zero, pref.UserId); | ||
213 | if(string.IsNullOrEmpty(account.Email)) | ||
214 | { | ||
215 | result = "No Email address on record!"; | ||
216 | return false; | ||
217 | } | ||
218 | else | ||
219 | pref.EMail = account.Email; | ||
220 | } | ||
221 | catch | ||
222 | { | ||
223 | m_log.Info ("[PROFILES]: UserAccountService Exception: Could not get user account"); | ||
224 | result = "Missing Email address!"; | ||
225 | return false; | ||
226 | } | ||
227 | } | ||
228 | else | ||
229 | { | ||
230 | m_log.Info ("[PROFILES]: UserAccountService: Could not get user account"); | ||
231 | result = "Missing Email address!"; | ||
232 | return false; | ||
233 | } | ||
234 | } | ||
174 | return ProfilesData.GetUserPreferences(ref pref, ref result); | 235 | return ProfilesData.GetUserPreferences(ref pref, ref result); |
175 | } | 236 | } |
176 | #endregion User Preferences | 237 | #endregion User Preferences |