Located posts: local only, rounded, matched against their own radius

A post given a latitude and longitude becomes LocalGeo: its position is
rounded to two decimals (about a kilometre) and stored as a 2dsphere
point, its radius clamped to 1-50 km, and it is local only - no Create,
no delivery, no outbox, never in the Mastodon API or on a profile page.
/clientapi/post/nearby takes the viewer's position for the query only
(it is neither stored nor logged), runs $geoNear and keeps posts within
each post's own radius, minus authors the viewer blocks or mutes. A
located post cannot be direct or in a group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012CzABvBkbcFqoHdmi8b9WB
This commit is contained in:
thepraandClaude Opus 5.5 committed 2026-10-01 12:24:30 +02:00
1 parent 28b581b6b1
commit c00865d805
8 files changed
+150 -3

No files matched your search

+5
View File
@@ -1,3 +1,4 @@
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Entities;
namespace PrivaPub.Models.Post
@@ -24,6 +25,10 @@ namespace PrivaPub.Models.Post
public List<PostMedia> Media { get; set; } = new();
public List<float> Location { get; set; } = new();
public float RangeKm { get; set; } = 5.0f;
[BsonIgnoreIfNull]
public Coordinates2D Geo { get; set; }
[BsonIgnoreIfNull]
public double? Distance { get; set; }
public bool HasContentWarning { get; set; } = false;
public bool IsLocalOnly { get; set; }