diff options
author | Justin Clark-Casey (justincc) | 2011-06-02 21:48:50 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-06-02 21:48:50 +0100 |
commit | b8e2ee69785e8f114748ab9f08cb34b45abde456 (patch) | |
tree | 1294b2fb6730eebef863f220e782136aa48aa08f /OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs | |
parent | minor: add ini.example doc to hint that the server address in [FreeswitchServ... (diff) | |
parent | HG IM: increase the timeout value (diff) | |
download | opensim-SC_OLD-b8e2ee69785e8f114748ab9f08cb34b45abde456.zip opensim-SC_OLD-b8e2ee69785e8f114748ab9f08cb34b45abde456.tar.gz opensim-SC_OLD-b8e2ee69785e8f114748ab9f08cb34b45abde456.tar.bz2 opensim-SC_OLD-b8e2ee69785e8f114748ab9f08cb34b45abde456.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs')
-rw-r--r-- | OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs index 9969086..fc97d8c 100644 --- a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs | |||
@@ -160,9 +160,9 @@ namespace OpenSim.Server.Handlers.Friends | |||
160 | 160 | ||
161 | byte[] StoreFriend(Dictionary<string, object> request) | 161 | byte[] StoreFriend(Dictionary<string, object> request) |
162 | { | 162 | { |
163 | FriendInfo friend = new FriendInfo(request); | 163 | string principalID = string.Empty, friend = string.Empty; int flags = 0; |
164 | 164 | FromKeyValuePairs(request, out principalID, out friend, out flags); | |
165 | bool success = m_FriendsService.StoreFriend(friend.PrincipalID.ToString(), friend.Friend, friend.MyFlags); | 165 | bool success = m_FriendsService.StoreFriend(principalID, friend, flags); |
166 | 166 | ||
167 | if (success) | 167 | if (success) |
168 | return SuccessResult(); | 168 | return SuccessResult(); |
@@ -275,6 +275,19 @@ namespace OpenSim.Server.Handlers.Friends | |||
275 | return ms.ToArray(); | 275 | return ms.ToArray(); |
276 | } | 276 | } |
277 | 277 | ||
278 | void FromKeyValuePairs(Dictionary<string, object> kvp, out string principalID, out string friend, out int flags) | ||
279 | { | ||
280 | principalID = string.Empty; | ||
281 | if (kvp.ContainsKey("PrincipalID") && kvp["PrincipalID"] != null) | ||
282 | principalID = kvp["PrincipalID"].ToString(); | ||
283 | friend = string.Empty; | ||
284 | if (kvp.ContainsKey("Friend") && kvp["Friend"] != null) | ||
285 | friend = kvp["Friend"].ToString(); | ||
286 | flags = 0; | ||
287 | if (kvp.ContainsKey("MyFlags") && kvp["MyFlags"] != null) | ||
288 | Int32.TryParse(kvp["MyFlags"].ToString(), out flags); | ||
289 | } | ||
290 | |||
278 | #endregion | 291 | #endregion |
279 | } | 292 | } |
280 | } | 293 | } |