public GroupInviteInfo GetAgentToGroupInvite(string RequestingAgentID, UUID inviteID) { Dictionary <string, object> sendData = new Dictionary <string, object>(); sendData["InviteID"] = inviteID.ToString(); sendData["RequestingAgentID"] = RequestingAgentID; sendData["OP"] = "GET"; Dictionary <string, object> ret = MakeRequest("INVITE", sendData); if (ret == null) { return(null); } if (!ret.ContainsKey("RESULT")) { return(null); } if (ret["RESULT"].ToString() == "NULL") { return(null); } return(GroupsDataUtils.GroupInviteInfo((Dictionary <string, object>)ret["RESULT"])); }
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))); } }