mirror of
https://github.com/NicolasConstant/BirdsiteLive
synced 2025-06-05 21:49:16 +02:00
testing deletion
This commit is contained in:
9
src/BirdsiteLive.ActivityPub/Models/Tombstone.cs
Normal file
9
src/BirdsiteLive.ActivityPub/Models/Tombstone.cs
Normal file
@@ -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");
|
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]
|
[HttpPost]
|
||||||
public async Task<IActionResult> PostNote()
|
public async Task<IActionResult> PostNote()
|
||||||
{
|
{
|
||||||
@@ -70,6 +99,8 @@ namespace BirdsiteLive.Controllers
|
|||||||
var noteId = $"https://{_instanceSettings.Domain}/users/{username}/statuses/{noteGuid}";
|
var noteId = $"https://{_instanceSettings.Domain}/users/{username}/statuses/{noteGuid}";
|
||||||
var noteUrl = $"https://{_instanceSettings.Domain}/@{username}/{noteGuid}";
|
var noteUrl = $"https://{_instanceSettings.Domain}/@{username}/{noteGuid}";
|
||||||
|
|
||||||
|
_noteId = noteId;
|
||||||
|
|
||||||
var to = $"{actor}/followers";
|
var to = $"{actor}/followers";
|
||||||
to = target;
|
to = target;
|
||||||
|
|
||||||
|
@@ -18,6 +18,11 @@
|
|||||||
<button type="submit" value="Submit">Post Note</button>
|
<button type="submit" value="Submit">Post Note</button>
|
||||||
</form>
|
</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">
|
<form asp-controller="Debuging" asp-action="PostRejectFollow" method="post">
|
||||||
<!-- Input and Submit elements -->
|
<!-- Input and Submit elements -->
|
||||||
|
Reference in New Issue
Block a user