testing deletion
This commit is contained in:
parent
f8ab522505
commit
432484eaaa
|
@ -0,0 +1,9 @@
|
|||
namespace BirdsiteLive.ActivityPub.Models
|
||||
{
|
||||
public class Tombstone
|
||||
{
|
||||
public string id { get; set; }
|
||||
public readonly string type = "Tombstone";
|
||||
public string atomUrl { get; set; }
|
||||
}
|
||||
}
|
|
@ -56,6 +56,35 @@ namespace BirdsiteLive.Controllers
|
|||
return View("Index");
|
||||
}
|
||||
|
||||
private static string _noteId;
|
||||
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> DeleteNote()
|
||||
{
|
||||
var username = "twitter";
|
||||
var actor = $"https://{_instanceSettings.Domain}/users/{username}";
|
||||
var targetHost = "ioc.exchange";
|
||||
var target = $"https://{targetHost}/users/test";
|
||||
var inbox = $"/inbox";
|
||||
|
||||
var delete = new ActivityDelete
|
||||
{
|
||||
context = "https://www.w3.org/ns/activitystreams",
|
||||
id = $"{_noteId}#delete",
|
||||
type = "Delete",
|
||||
actor = actor,
|
||||
to = new[] { "https://www.w3.org/ns/activitystreams#Public" },
|
||||
apObject = new Tombstone
|
||||
{
|
||||
id = _noteId,
|
||||
atomUrl = _noteId
|
||||
}
|
||||
};
|
||||
|
||||
await _activityPubService.PostDataAsync(delete, targetHost, actor, inbox);
|
||||
return View("Index");
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> PostNote()
|
||||
{
|
||||
|
@ -70,6 +99,8 @@ namespace BirdsiteLive.Controllers
|
|||
var noteId = $"https://{_instanceSettings.Domain}/users/{username}/statuses/{noteGuid}";
|
||||
var noteUrl = $"https://{_instanceSettings.Domain}/@{username}/{noteGuid}";
|
||||
|
||||
_noteId = noteId;
|
||||
|
||||
var to = $"{actor}/followers";
|
||||
to = target;
|
||||
|
||||
|
|
|
@ -18,6 +18,11 @@
|
|||
<button type="submit" value="Submit">Post Note</button>
|
||||
</form>
|
||||
|
||||
<form asp-controller="Debuging" asp-action="DeleteNote" method="post">
|
||||
<!-- Input and Submit elements -->
|
||||
|
||||
<button type="submit" value="Submit">Delete Note</button>
|
||||
</form>
|
||||
|
||||
<form asp-controller="Debuging" asp-action="PostRejectFollow" method="post">
|
||||
<!-- Input and Submit elements -->
|
||||
|
|
Loading…
Reference in New Issue