Moves carry follows over; first DMs to Lemmy 0.19 and Mbin go as ChatMessage
Two owner decisions of 2026-10-05, both recorded in ROADMAP: - After a verified Move the personas following the old account follow the new one, in the same lists, and a mute or block of the old account carries over, as Mastodon does it. - A direct message to one account on a server whose NodeInfo names Lemmy before 1.0 or Mbin goes as a ChatMessage, the one place PrivaPub decides by a server's software (invariant 17). G-0008 is closed. Mbin addresses its private messages to the recipient's profile page, so a Create addressed to a persona's /@name now reaches the persona. Checked live: moves 8/8, Lemmy 0.19 30/30, Mbin 26/26 with messages both ways. The software theory runs alone, since every test's peer shares 127.0.0.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
1 parent
f3e8cce2ed
commit
7b0377c85f
19 files changed
+309
-63
No files matched your search
@@ -2,6 +2,7 @@ using MongoDB.Entities;
|
||||
|
||||
using PrivaPub.ClientModels.Post;
|
||||
using PrivaPub.Federation.Objects;
|
||||
using PrivaPub.Models.Group;
|
||||
using PrivaPub.Models.Post;
|
||||
using PrivaPub.Tests.Support;
|
||||
|
||||
@@ -106,6 +107,32 @@ namespace PrivaPub.Tests.Federation
|
||||
Assert.NotNull(message.ConversationId);
|
||||
}
|
||||
|
||||
// Mbin addresses its private messages to the recipient's profile page (its `url`), not to the actor
|
||||
[Fact]
|
||||
public async Task A_chat_message_addressed_to_a_personas_profile_page_reaches_the_persona()
|
||||
{
|
||||
var token = TestContext.Current.CancellationToken;
|
||||
var (_, alice) = await _harness.Persona("alice");
|
||||
var mbin = new RemoteActor(_harness.Peer, "mbuser");
|
||||
var messageId = NewId(mbin, "f/object");
|
||||
|
||||
await _harness.Deliver(mbin, "/human-centipede", new JsonObject
|
||||
{
|
||||
["id"] = NewId(mbin, "f/object"), ["type"] = "Create", ["actor"] = mbin.Id, ["to"] = new JsonArray(alice.HtmlUrl), ["cc"] = new JsonArray(),
|
||||
["object"] = new JsonObject
|
||||
{
|
||||
["id"] = messageId, ["type"] = "ChatMessage", ["attributedTo"] = mbin.Id, ["to"] = new JsonArray(alice.HtmlUrl), ["cc"] = new JsonArray(),
|
||||
["content"] = "<p>an answer</p>", ["mediaType"] = "text/html", ["published"] = DateTime.UtcNow.ToString("O")
|
||||
}
|
||||
});
|
||||
|
||||
var message = await DB.Default.Find<Post>().Match(p => p.ObjectURI == messageId).ExecuteFirstAsync(token);
|
||||
Assert.NotNull(message);
|
||||
Assert.Equal(PostVisibility.Direct, message.Visibility);
|
||||
var conversation = await DB.Default.Find<DmGroup>().OneAsync(message.ConversationId, token);
|
||||
Assert.Equal(new[] { alice.Id, mbin.Id }.Order(StringComparer.Ordinal), conversation.Members.Select(m => m.AvatarId).Order(StringComparer.Ordinal));
|
||||
}
|
||||
|
||||
// Lemmy 0.19 and Mbin take a private message only as a ChatMessage: someone who writes to us that way is answered in
|
||||
// kind, anyone else with a Note
|
||||
[Fact]
|
||||
|
||||
Reference in new issue
Block a user