byte[] HandleInvite(Dictionary <string, object> request) { Dictionary <string, object> result = new Dictionary <string, object>(); if (!request.ContainsKey("RequestingAgentID") || !request.ContainsKey("InviteID")) { NullResult(result, "Bad network data"); string xmlString = ServerUtils.BuildXmlResponse(result); return(Util.UTF8NoBomEncoding.GetBytes(xmlString)); } else { string op = request["OP"].ToString(); if (op == "ADD" && request.ContainsKey("GroupID") && request.ContainsKey("RoleID") && request.ContainsKey("AgentID")) { bool success = m_GroupsService.AddAgentToGroupInvite(request["RequestingAgentID"].ToString(), new UUID(request["InviteID"].ToString()), new UUID(request["GroupID"].ToString()), new UUID(request["RoleID"].ToString()), request["AgentID"].ToString()); result["RESULT"] = success.ToString(); return(Util.UTF8NoBomEncoding.GetBytes(ServerUtils.BuildXmlResponse(result))); } else if (op == "DELETE") { m_GroupsService.RemoveAgentToGroupInvite(request["RequestingAgentID"].ToString(), new UUID(request["InviteID"].ToString())); result["RESULT"] = "true"; return(Util.UTF8NoBomEncoding.GetBytes(ServerUtils.BuildXmlResponse(result))); } else if (op == "GET") { GroupInviteInfo invite = m_GroupsService.GetAgentToGroupInvite(request["RequestingAgentID"].ToString(), new UUID(request["InviteID"].ToString())); if (invite != null) { result["RESULT"] = GroupsDataUtils.GroupInviteInfo(invite); } else { result["RESULT"] = "NULL"; } return(Util.UTF8NoBomEncoding.GetBytes(ServerUtils.BuildXmlResponse(result))); } NullResult(result, "Bad OP in request"); return(Util.UTF8NoBomEncoding.GetBytes(ServerUtils.BuildXmlResponse(result))); } }
public void RemoveAgentToGroupInvite(string RequestingAgentID, UUID inviteID) { m_GroupsService.RemoveAgentToGroupInvite(RequestingAgentID, inviteID); }