Commit graph

85 commits

Author SHA1 Message Date
Laura Hausmann
df3e56f422
[backend/core] Prevent creation of pure renote replies 2025-02-19 16:37:11 +01:00
Laura Hausmann
88dee6b410
[backend/api] Replace IEntity with IIdentifiable, move EntityWrapper<T> to shared project 2025-02-18 21:47:33 +01:00
Kopper
7595f257f8 [backend/masto-client] Use List<> instead of HashSet<> for batch endpoints
CustomCollectionModelBinder's `as IList` cast does not work for HashSet,
breaking the code around trailing []s in query arguments.

The values are still being treated as a set in the query so adding the
same value multiple times shouldn't do anything except hit the max limit
quicker.

The intention was to aid clients which may not be doing their own
deduplication but I haven't really observed that behavior in the wild
and I doubt it's anything too much to expect from clients.

That said, testing on mastodon.social shows Mastodon itself may be doing
deduplication here before checking the limit, though I'm not entirely sure
if this will ever be noticed in the wild.
2025-02-04 10:19:24 +03:00
Kopper
02d4b35ab1
[backend/masto-client] Limit batch endpoints 2025-01-20 18:21:21 +01:00
Kopper
ad00ddd14e
[backend/masto-client] Implement /api/v1/statuses (View multiple statuses) 2025-01-20 18:21:20 +01:00
Laura Hausmann
9865f3dde7
[backend/core] Replace MFM line endings during user/note ingestion
This saves significant amounts of time & memory during parsing.
2024-12-15 00:11:31 +01:00
Laura Hausmann
00e157cc7e
[parsing] Switch to MfmSharp 2024-12-06 18:14:00 +01:00
Laura Hausmann
862d477dec
[backend/masto-client] Remove confusing status context logic
This does technically match Mastodon's behavior, but it doesn't match the behavior of iceshrimp-js, or the Iceshrimp.NET web API. It's also very confusing.
2024-11-20 01:56:41 +01:00
Kopper
40b35a7bd2 [backend/akko-client] Handle "local" visibility (ISH-559) 2024-11-06 13:06:18 +03:00
Laura Hausmann
f2853d2d40
[backend] Fix typo 2024-11-02 22:56:52 +01:00
Laura Hausmann
dc7e45c7cb
[backend/masto-client] Fix StatusController quote lookup precedence 2024-10-29 16:14:54 +01:00
kopper
27ac36d747
[backend] Add config option to sign reply backfills with requesting user
Signed-off-by: Laura Hausmann <laura@hausmann.dev>
2024-10-24 21:18:58 +02:00
kopper
7173373330
[backend/federation] Improved reply backfill
Instead of backfilling every note we come across that has a reply
collection, only schedule a backfill job if someone wants to see the
replies (on GET MastoAPI /context, or Iceshrimp API /descendants)

Reply backfilling is also done on a ThreadIdOrId basis as opposed to the
previous way of backfilling individual notes. This allows us finer
grained control over the recursion and frees up the job queue, alongside
allowing for easier implementation of context collection backfill in the
future (by mapping each context collection to a thread)

---

Currently, note threads are implicit based on the "threadId" column of a
note, which can be null (where it's the same as the note's "id")

This commit turns note threads into an actual entity, and as a part of
that, makes "threadId" non-nullable (by specifically setting it to "id"
for those cases)

This is done to attach extra metadata to the entire thread, currently
just the time of when it was last backfilled, but more may be added in
the future (the context collection associated with this thread, for example)

---

The data format for backfill jobs have backwards-incompatibly changed
since the introduction of the feature. We can drop all old jobs without
causing too much trouble as they will be re-scheduled on demand

---

Signed-off-by: Laura Hausmann <laura@hausmann.dev>
2024-10-24 21:18:57 +02:00
Laura Hausmann
a5a2c0b169
[backend/core] Add basic reject policies, along with a highly extensible system for rewrite policies (ISH-16) 2024-10-09 04:34:23 +02:00
Laura Hausmann
304d9f2750
[backend/masto-client] Enforce RestrictedNoMedia public preview mode 2024-09-24 01:02:05 +02:00
Kopper
bcb6382c73 [backend/akko-client] Fix context of boosts 2024-09-13 17:30:05 +02:00
Kopper
410519dafa [backend/akko-client] Stub out preview flag to not accidentally spam people 2024-09-13 17:30:05 +02:00
Laura Hausmann
1e8f1cb964
[backend/database] Migrate references to Note.ThreadId ?? Note.Id to Note.ThreadIdOrId 2024-07-14 22:06:29 +02:00
Laura Hausmann
6b6bb53668
[backend/masto-client] Add note mute/unmute endpoints (ISH-417) 2024-07-14 22:06:29 +02:00
Laura Hausmann
0776a50cbe
[backend/asp] Refactor controllers
This commit aims to improve readability of MVC controllers & actions. The main change is the switch to custom [ProducesResults] and [ProducesErrors] attributes.
2024-07-06 17:12:22 +02:00
Laura Hausmann
0a89a228e3
[backend] Refactor Controllers folder 2024-07-04 18:17:50 +02:00
Laura Hausmann
df3a7bdfe5
[backend] Apply formatting rules 2024-06-29 01:06:19 +02:00
Laura Hausmann
36296cd28c
[backend/masto-client] Fix poll endpoint authentication (ISH-377) 2024-06-20 19:38:16 +02:00
Laura Hausmann
364d0c54a0
[backend/masto-client] Paginate note likes & renotes correctly (ISH-362) 2024-06-15 17:30:12 +02:00
Laura Hausmann
167fd5f0d6
[backend/api] Add renote endpoints (ISH-341) 2024-05-23 19:37:56 +02:00
Laura Hausmann
d109f00d55
[backend/api] Add idempotency key support to NoteController.CreateNote (ISH-294) 2024-05-07 01:41:05 +02:00
Laura Hausmann
616a70a73a
[backend/masto-client] Return 422 when trying to create a scheduled status (ISH-315) 2024-05-03 21:15:23 +02:00
Laura Hausmann
2265f1d4cb
[backend/masto-client] Use AsyncKeyedLocker when checking idempotency keys 2024-05-03 18:05:05 +02:00
Laura Hausmann
6c2215e30d
[backend/masto-client] Fix NullReferenceExceptions in StatusController 2024-05-03 01:32:19 +02:00
Laura Hausmann
d193ac26d7
[backend/masto-client] Disallow unauthenticated access to public note/user API endpoints when public preview is restricted (ISH-288) 2024-05-02 23:08:47 +02:00
Laura Hausmann
21c042453c
[backend/masto-client] Set sensitive flag on drive files when posting sensitive status (ISH-292) 2024-05-02 22:39:42 +02:00
Laura Hausmann
0e6864fe38
[backend/api-shared] Order note ancestors by tree path
Background: the database function might not return these in the correct order, as the ids will almost, but not always be in the right order.
2024-05-01 23:39:49 +02:00
Laura Hausmann
a75fcfa43b
[backend/masto-client] Fix NullReferenceException on status edit history (ISH-293) 2024-04-29 00:21:41 +02:00
Laura Hausmann
61adc27b18
[backend/masto-client] Use new defaultRenoteVisibility user setting instead of defaulting to followers if not explicitly specified (ISH-290) 2024-04-28 23:09:20 +02:00
Laura Hausmann
0cef680c9c
[backend/masto-client] Fix boosting posts using masto-fe
I have no idea why the Mastodon API schema is like this but oh well.
2024-04-28 01:10:54 +02:00
Laura Hausmann
128b0182fd
[backend/masto-client] Fix reblog with visibility 2024-04-28 00:57:01 +02:00
Laura Hausmann
5f86ffeffe
[backend/masto-client] Add edit history endpoint (ISH-274) 2024-04-25 02:08:30 +02:00
Laura Hausmann
5fca0620cf
[backend/core] Improve note table query performance by aggregating block/mute checks (ISH-206)
This also implements checking for blocks & mutes users in the mentions field, implementing ISH-225.
2024-04-23 23:04:56 +02:00
Laura Hausmann
969622bfc7
[backend/api] Return note descendants in tree form (ISH-242)
This also partially addresses thread ordering in the Mastodon client API.
2024-04-07 20:43:28 +02:00
Laura Hausmann
62dde50af2
[backend/core] Support note filters (ISH-97) 2024-03-31 23:56:55 +02:00
Laura Hausmann
d9a4b406e4
[backend/masto-client] Enforce mutes & blocks in more places 2024-03-25 12:42:48 +01:00
Laura Hausmann
9bd421c3a0
[backend] Replace old MfmParser with the new F# implementation (ISH-112) 2024-03-24 23:10:39 +01:00
Laura Hausmann
e3e34b4495
[backend/masto-client] Make idempotency keys unique by user id 2024-03-23 19:10:27 +01:00
Laura Hausmann
c6300d1c96
[backend/core] Replace IDistributedCache with postgres k/v cache (ISH-212) 2024-03-23 19:10:27 +01:00
Laura Hausmann
a408fa247a
[backend] Code cleanup 2024-03-17 13:36:08 +01:00
Laura Hausmann
a2075d4c63
[backend/masto-client] Add missing media endpoints, handle media_attributes on status update (ISH-155) 2024-03-14 12:10:03 +01:00
Laura Hausmann
d4fe223552
[backend/masto-client] Improve quote handling (ISH-176) 2024-03-13 05:01:46 +01:00
Laura Hausmann
abf93138e1
[backend/masto-client] Add renoted_by & favourited_by endpoints (ISH-181) 2024-03-13 03:22:00 +01:00
Laura Hausmann
91137b7fd9
[backend/api] Add reactions endpoints & return reaction data with note & timeline responses (ISH-156) 2024-03-11 05:20:07 +01:00
Laura Hausmann
bef11d5cca
[backend/masto-client] Add local_only & quote_id parameters on POST /statuses (ISH-146) 2024-03-11 02:32:18 +01:00