Files
SocialPub/PrivaPub/Models/Social/Relationships.cs
T
thepraandClaude Opus 5.5 8f75317050 Blocks, mutes, bookmarks, pins and reports
- Blocks are per persona and never federate (a Block activity would tell
  the other server who blocked whom): the blocked account is removed as a
  follower, with a Reject{Follow} if it is remote, unfollowed, cleared from
  home and notifications, and refused with Reject if it follows again.
- Mutes (optionally timed, optionally sparing notifications) and per-
  persona domain blocks keep authors out of home timelines, notifications
  and every status list the API returns; the boosts of a hidden author's
  posts are hidden too.
- Bookmarks and pins (at most five, public or unlisted, own posts) with
  their Mastodon endpoints and flags; pinned posts are the actor's
  `featured` collection at /trophies, and `featuredTags` points at
  /tattoos.
- Reports: /api/v1/reports stores the report and, when forwarding to a
  remote account, sends Flag from the instance actor, so the reporting
  persona is never named to the other server. An inbound Flag about a local
  persona or its posts becomes a report; moderators list and resolve them
  under /clientapi/moderator/reports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012CzABvBkbcFqoHdmi8b9WB
2026-10-01 12:13:57 +02:00

61 lines
1.7 KiB
C#

using MongoDB.Entities;
namespace PrivaPub.Models.Social
{
public class Block : Entity
{
public string AvatarId { get; set; }
public string TargetAccountId { get; set; }
public string TargetActorURI { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}
public class Mute : Entity
{
public string AvatarId { get; set; }
public string TargetAccountId { get; set; }
public string TargetActorURI { get; set; }
public bool HideNotifications { get; set; } = true;
public DateTime? ExpiresAt { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}
public class AccountDomainBlock : Entity
{
public string AvatarId { get; set; }
public string Domain { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}
public class Bookmark : Entity
{
public string AvatarId { get; set; }
public string PostId { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}
public class Pin : Entity
{
public string AvatarId { get; set; }
public string PostId { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}
public class Report : Entity
{
public string ReporterAvatarId { get; set; }
public string ReporterActorURI { get; set; }
public string TargetAccountId { get; set; }
public string TargetActorURI { get; set; }
public List<string> PostIds { get; set; } = new();
public List<string> ObjectURIs { get; set; } = new();
public string Category { get; set; } = "other";
public string Comment { get; set; }
public bool Forwarded { get; set; }
public bool IsResolved { get; set; }
public string ResolvedBy { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime? ResolvedAt { get; set; }
}
}