diff options
author | onefang | 2019-05-19 21:24:15 +1000 |
---|---|---|
committer | onefang | 2019-05-19 21:24:15 +1000 |
commit | 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb (patch) | |
tree | a9fbc62df9eb2d1d9ba2698d8552eae71eca20d8 /OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs | |
parent | Add a build script. (diff) | |
download | opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.zip opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.gz opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.bz2 opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.xz |
Dump OpenSim 0.9.0.1 into it's own branch.
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs index 13512a2..091b197 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs | |||
@@ -65,9 +65,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
65 | protected override byte[] ProcessRequest( | 65 | protected override byte[] ProcessRequest( |
66 | string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 66 | string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
67 | { | 67 | { |
68 | StreamReader sr = new StreamReader(requestData); | 68 | string body; |
69 | string body = sr.ReadToEnd(); | 69 | using(StreamReader sr = new StreamReader(requestData)) |
70 | sr.Close(); | 70 | body = sr.ReadToEnd(); |
71 | |||
71 | body = body.Trim(); | 72 | body = body.Trim(); |
72 | 73 | ||
73 | //m_log.DebugFormat("[XXX]: query String: {0}", body); | 74 | //m_log.DebugFormat("[XXX]: query String: {0}", body); |
@@ -127,7 +128,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
127 | UserAccount account = m_FriendsModule.UserAccountService.GetUserAccount(UUID.Zero, fromID); | 128 | UserAccount account = m_FriendsModule.UserAccountService.GetUserAccount(UUID.Zero, fromID); |
128 | string name = (account == null) ? "Unknown" : account.FirstName + " " + account.LastName; | 129 | string name = (account == null) ? "Unknown" : account.FirstName + " " + account.LastName; |
129 | 130 | ||
130 | GridInstantMessage im = new GridInstantMessage(m_FriendsModule.Scene, fromID, name, toID, | 131 | GridInstantMessage im = new GridInstantMessage(m_FriendsModule.Scene, fromID, name, toID, |
131 | (byte)InstantMessageDialog.FriendshipOffered, message, false, Vector3.Zero); | 132 | (byte)InstantMessageDialog.FriendshipOffered, message, false, Vector3.Zero); |
132 | 133 | ||
133 | // !! HACK | 134 | // !! HACK |
@@ -211,7 +212,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
211 | { | 212 | { |
212 | UUID fromID = UUID.Zero; | 213 | UUID fromID = UUID.Zero; |
213 | UUID toID = UUID.Zero; | 214 | UUID toID = UUID.Zero; |
214 | int rights = 0, userFlags = 0; | 215 | int oldRights = 0, newRights = 0; |
215 | 216 | ||
216 | if (!request.ContainsKey("FromID") || !request.ContainsKey("ToID")) | 217 | if (!request.ContainsKey("FromID") || !request.ContainsKey("ToID")) |
217 | return FailureResult(); | 218 | return FailureResult(); |
@@ -222,13 +223,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
222 | if (!UUID.TryParse(request["ToID"].ToString(), out toID)) | 223 | if (!UUID.TryParse(request["ToID"].ToString(), out toID)) |
223 | return FailureResult(); | 224 | return FailureResult(); |
224 | 225 | ||
225 | if (!Int32.TryParse(request["UserFlags"].ToString(), out userFlags)) | 226 | if (!Int32.TryParse(request["UserFlags"].ToString(), out oldRights)) |
226 | return FailureResult(); | 227 | return FailureResult(); |
227 | 228 | ||
228 | if (!Int32.TryParse(request["Rights"].ToString(), out rights)) | 229 | if (!Int32.TryParse(request["Rights"].ToString(), out newRights)) |
229 | return FailureResult(); | 230 | return FailureResult(); |
230 | 231 | ||
231 | if (m_FriendsModule.LocalGrantRights(UUID.Zero, UUID.Zero, userFlags, rights)) | 232 | if (m_FriendsModule.LocalGrantRights(fromID, toID, oldRights, newRights)) |
232 | return SuccessResult(); | 233 | return SuccessResult(); |
233 | 234 | ||
234 | return FailureResult(); | 235 | return FailureResult(); |