public bool DeleteFriendship(UUID PrincipalID, UUID Friend, string secret)
{
FriendInfo finfo = new FriendInfo ();
finfo.PrincipalID = PrincipalID;
finfo.Friend = Friend.ToString ();
Dictionary<string, object> sendData = finfo.ToKVP();
sendData["METHOD"] = "deletefriendship";
sendData["SECRET"] = secret;
string reply = string.Empty;
try
{
reply = SynchronousRestFormsRequester.MakeRequest ("POST",
m_ServerURI + "/hgfriends",
WebUtils.BuildQueryString (sendData));
}
catch (Exception e)
{
MainConsole.Instance.DebugFormat ("[HGFRIENDS CONNECTOR]: Exception when contacting friends server: {0}", e.Message);
return false;
}
if (reply != string.Empty)
{
Dictionary<string, object> replyData = WebUtils.ParseXmlResponse (reply);
if ((replyData != null) && replyData.ContainsKey ("Result") && (replyData["Result"] != null))
{
bool success = false;
Boolean.TryParse (replyData["Result"].ToString (), out success);
return success;
}
else
MainConsole.Instance.DebugFormat ("[HGFRIENDS CONNECTOR]: Delete {0} {1} received null response",
PrincipalID, Friend);
}
else
MainConsole.Instance.DebugFormat ("[HGFRIENDS CONNECTOR]: DeleteFriend received null reply");
return false;
}