fix bork'd RequestBanAction
This commit is contained in:
parent
4f708621fa
commit
c0be75434c
2 changed files with 11 additions and 14 deletions
|
|
@ -1709,21 +1709,21 @@ namespace OpenMetaverse
|
|||
/// <param name="callback">Callback</param>
|
||||
public void RequestBanAction(UUID groupID, GroupBanAction action, UUID[] agents, EventHandler<EventArgs> callback)
|
||||
{
|
||||
Uri uri = GetGroupAPIUri(groupID);
|
||||
if (uri == null) { return; }
|
||||
|
||||
Uri cap = Client.Network.CurrentSim.Caps.CapabilityURI("GroupBanAction");
|
||||
if (cap == null) { return; }
|
||||
|
||||
Uri baseCap = GetGroupAPIUri(groupID);
|
||||
if (baseCap == null)
|
||||
{
|
||||
Logger.Log("Unable to get Cap url for GroupAPIv1", Helpers.LogLevel.Warning, Client);
|
||||
}
|
||||
OSDMap payload = new OSDMap { ["ban_action"] = (int)action };
|
||||
OSDArray banIDs = new OSDArray(agents.Length);
|
||||
foreach (var agent in agents)
|
||||
for (int i = 0; i < agents.Length; i++)
|
||||
{
|
||||
UUID agent = agents[i];
|
||||
banIDs.Add(agent);
|
||||
}
|
||||
payload["ban_ids"] = banIDs;
|
||||
|
||||
Task req = Client.HttpCapsClient.PostRequestAsync(cap, OSDFormat.Xml, payload, CancellationToken.None,
|
||||
Task req = Client.HttpCapsClient.PostRequestAsync(baseCap, OSDFormat.Xml, payload, CancellationToken.None,
|
||||
(response, data, error) =>
|
||||
{
|
||||
if (error != null) { return; }
|
||||
|
|
|
|||
|
|
@ -75,12 +75,9 @@ namespace SecondBotEvents.Commands
|
|||
{
|
||||
Action = GroupBanAction.Unban;
|
||||
}
|
||||
List<UUID> avatarstoaction =
|
||||
[
|
||||
avataruuid
|
||||
];
|
||||
GetClient().Groups.RequestBanAction(groupuuid, Action, [.. avatarstoaction]);
|
||||
return BasicReply("Accepted");
|
||||
GetClient().Groups.EjectUser(groupuuid, avataruuid); //Eject first
|
||||
GetClient().Groups.RequestBanAction(groupuuid, Action, [avataruuid]);
|
||||
return BasicReply("Accepted "+ Action.ToString()+" for "+avataruuid);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue