diff options
author | Diva Canto | 2011-05-22 16:51:03 -0700 |
---|---|---|
committer | Diva Canto | 2011-05-22 16:51:03 -0700 |
commit | 336665e03532cf9d7a1ad65d5071e7050bf6ecd0 (patch) | |
tree | 45c7c1145de1b5af3ff198bcb29564a2547e4575 /OpenSim/Server/Handlers/Friends | |
parent | File to be removed (diff) | |
download | opensim-SC_OLD-336665e03532cf9d7a1ad65d5071e7050bf6ecd0.zip opensim-SC_OLD-336665e03532cf9d7a1ad65d5071e7050bf6ecd0.tar.gz opensim-SC_OLD-336665e03532cf9d7a1ad65d5071e7050bf6ecd0.tar.bz2 opensim-SC_OLD-336665e03532cf9d7a1ad65d5071e7050bf6ecd0.tar.xz |
More on HG Friends. Added Delete(string, string) across the board. Added security to friendship identifiers so that they can safely be deleted across worlds. Had to change Get(string) to use LIKE because the secret in the identifier is not always known -- affects only HG visitors. BOTTOM LINE SO FAR: HG friendships established and deleted safely across grids, local rights working but not (yet?) being transmitted back.
Diffstat (limited to 'OpenSim/Server/Handlers/Friends')
-rw-r--r-- | OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs index 71c3c73..9969086 100644 --- a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs | |||
@@ -91,6 +91,9 @@ namespace OpenSim.Server.Handlers.Friends | |||
91 | case "deletefriend": | 91 | case "deletefriend": |
92 | return DeleteFriend(request); | 92 | return DeleteFriend(request); |
93 | 93 | ||
94 | case "deletefriend_string": | ||
95 | return DeleteFriendString(request); | ||
96 | |||
94 | } | 97 | } |
95 | m_log.DebugFormat("[FRIENDS HANDLER]: unknown method {0} request {1}", method.Length, method); | 98 | m_log.DebugFormat("[FRIENDS HANDLER]: unknown method {0} request {1}", method.Length, method); |
96 | } | 99 | } |
@@ -184,7 +187,25 @@ namespace OpenSim.Server.Handlers.Friends | |||
184 | else | 187 | else |
185 | return FailureResult(); | 188 | return FailureResult(); |
186 | } | 189 | } |
187 | 190 | ||
191 | byte[] DeleteFriendString(Dictionary<string, object> request) | ||
192 | { | ||
193 | string principalID = string.Empty; | ||
194 | if (request.ContainsKey("PRINCIPALID")) | ||
195 | principalID = request["PRINCIPALID"].ToString(); | ||
196 | else | ||
197 | m_log.WarnFormat("[FRIENDS HANDLER]: no principalID in request to delete friend"); | ||
198 | string friend = string.Empty; | ||
199 | if (request.ContainsKey("FRIEND")) | ||
200 | friend = request["FRIEND"].ToString(); | ||
201 | |||
202 | bool success = m_FriendsService.Delete(principalID, friend); | ||
203 | if (success) | ||
204 | return SuccessResult(); | ||
205 | else | ||
206 | return FailureResult(); | ||
207 | } | ||
208 | |||
188 | #endregion | 209 | #endregion |
189 | 210 | ||
190 | #region Misc | 211 | #region Misc |