Commit Graph
110 Commits
Author SHA1 Message Date
Eugen Rochko 1bbe3872f2 Change validation to permit polls and media being combined (#39203) 2026-06-10 15:20:21 +00:00
Eugen RochkoandClaire ee88da4511 Add admin UI for managing email subscriptions (#38741)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2026-05-04 13:56:04 +00:00
Eugen Rochko bcf0718a9a Add email subscriptions (#38163) 2026-03-25 16:25:45 +00:00
Claire 39d9da3b82 Tag linked FeaturedCollection objects over ActivityPub (#38115) 2026-03-23 13:11:33 +00:00
Claire 21576e29ab Refactor ProcessMentionsService to remove save_records parameter (#38277) 2026-03-23 09:12:30 +00:00
Claire cff25c186b Fix race condition when processing statuses twice with the same idempotency key (#37879) 2026-02-16 14:58:22 +00:00
Claire 9b3e92bf17 Prevent creation of Private Mentions quoting someone who is not mentioned (#36689) 2025-11-03 14:16:25 +00:00
Claire 28be5a199f Fix Private Messages self-quoting private posts being changed to followers-only (#36249) 2025-09-24 10:58:52 +00:00
Claire fbf093a87f Fix CW being moved to text when posting quote posts with empty text (#36151) 2025-09-17 12:19:00 +00:00
Claire 75fca715e9 Change public self-quotes of private posts to be disallowed (#35975) 2025-09-02 15:48:37 +00:00
Eugen Rochko 7fc884ba00 Fix banned text being able to be circumvented via unicode (#35978) 2025-09-02 07:29:03 +00:00
Claire 9ec99ffef1 Add quote_approval_policy parameter when posting and editing statuses (#35699) 2025-08-06 14:23:12 +00:00
Claire cb0b608fa7 Ensure quoted user is given access to see the post (#35665) 2025-08-04 16:06:59 +00:00
Claire 5a88b7f683 Add experimental basic quote post authoring (#35355) 2025-07-25 12:35:24 +00:00
Claire 17e4345eb2 Add quoted_status attribute to PostStatusService for local testing (#34553) 2025-04-28 10:07:22 +00:00
Claire dbddd40c1c Add stop-gap antispam code (#32981) 2024-11-21 14:06:57 +00:00
Matt Jankowski 73f66af6eb Update location of unused MIN_SCHEDULE_OFFSET constant (#31217) 2024-11-07 10:28:59 +00:00
Christian Schmidt a5bbe83dfd media_ids is an array of strings (#31709) 2024-09-02 20:18:09 +00:00
Christian Schmidt 491033c86c Reject status creation with invalid media_ids parameter (#31681) 2024-09-02 15:30:48 +00:00
Daniel M Brasil 77c2216e47 fix: Return HTTP 422 when scheduled status time is less than 5 minutes (#30584) 2024-06-10 13:33:48 +00:00
Matt Jankowski c61e356475 Add Status::MEDIA_ATTACHMENTS_LIMIT configuration constant (#30433) 2024-05-27 09:49:44 +00:00
Claire 91ca90e25b Fix Idempotency-Key ignored when scheduling a post (#30084) 2024-04-26 13:19:02 +00:00
Eugen RochkoandClaire b5ac61b2c5 Change algorithm of follow recommendations (#28314)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-12-19 10:59:43 +00:00
Nick Schonning 717683d1c3 Autofix Rubocop remaining Layout rules (#23679) 2023-02-20 06:58:28 +01:00
Claire d6930b3847 Add API parameter to safeguard unexpect mentions in new posts (#18350) 2023-02-13 16:36:29 +01:00
Brian CampbellandBrian Campbell 2d12948220 Fix idempotency when database writes are slow (#21840)
There is an idempotency key generated by clients when authoring a post,
and stored in Redis, to ensure that if a user or client retries posting
the same status, we don't get a duplicate.

Hachyderm.io has been experiencing some filesystem and database
performance issues, causing database writes to be slow. This can mean
that there are successful posts, but the reverse proxy returns 504
Gateway Timeout before the idempotency status has been updated; users or
clients who retry (such as Tusky which retries automatically, see
tuskyapp/Tusky#2951) can re-try the same post with the same idempotency
key before it has actually been recorded in Redis, leading to duplicate
posts.

To address this issue, move all of the database updates after the
initial transaction that creates the status into the
`postprocess_status!` method, so we can insert the idempotency key
immediately after the status has been created, significantly reducing
the window in which the status could be created but the idempotency key
not yet stored.

Note: this has not yet been tested; I'm submitting this PR for
discussion and to offer to the Hachyderm.io admins to try out to fix the
multiple posting problem.

Co-authored-by: Brian Campbell <brcampbell@beta.team>
2022-12-15 18:08:40 +01:00
Eugen RochkoandClaire d17fb70131 Change how changes to media attachments are stored for edits (#17696)
* Change how changes to media attachments are stored for edits

Fix not being able to re-order media attachments

* Fix not broadcasting updates when polls/media is changed through ActivityPub

* Various fixes and improvements

* Update app/models/report.rb

Co-authored-by: Claire <claire.github-309c@sitedethib.com>

* Add tracking of media attachment description changes

* Change poll in status edit to have a structure closer to the real one

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2022-03-09 09:06:17 +01:00
Eugen Rochko c0327ff31f Fix invalid language resulting in no fallback being set on statuses (#17722) 2022-03-09 08:46:05 +01:00
Eugen RochkoandYamagishi Kazutoshi b6d7726ecb Remove language detection through cld3 (#17478)
* Remove language detection through cld3

* Update app/helpers/languages_helper.rb

Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh>

Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh>
2022-02-08 02:41:17 +01:00
Eugen Rochko 6e50134a42 Add trending links (#16917)
* Add trending links

* Add overriding specific links trendability

* Add link type to preview cards and only trend articles

Change trends review notifications from being sent every 5 minutes to being sent every 2 hours

Change threshold from 5 unique accounts to 15 unique accounts

* Fix tests
2021-11-25 13:07:38 +01:00
Claire 216570ad98 Fix scheduled statuses decreasing statuses counts (#16791)
* Add tests

* Fix scheduled statuses decreasing statuses counts

Fixes #16774
2021-10-14 19:59:21 +02:00
ThibG f08f880f58 Fix media not being marked sensitive when client sets a CW but no text (#13277)
Mastodon enforces the “sensitive” flag on media attachments whenever a toot
is posted with a Content Warning. However, it does so *after* potentially
converting the Content Warning to toot text (when there is no toot text),
which leads to inconsistent and surprising behavior for API clients.
This commit fixes this inconsistency.
2020-03-25 22:40:58 +01:00
Eugen Rochko 9660aa4543 Change local media attachments to perform heavy processing asynchronously (#13210)
Fix #9106
2020-03-08 23:56:18 +01:00
ThibG 5284e29e2f Fix public posts from silenced accounts not being changed to unlisted visibility (#13096) 2020-03-08 16:11:49 +01:00
Eugen Rochko 339ce1c4e9 Add specific rate limits for posting and following (#13172) 2020-03-08 15:17:39 +01:00
ThibG 3babf8464b Add voters count support (#11917)
* Add voters count to polls

* Add ActivityPub serialization and parsing of voters count

* Add support for voters count in WebUI

* Move incrementation of voters count out of redis lock

* Reword “voters” to “people”
2019-09-29 22:58:01 +02:00
Eugen Rochko 23aeef52cc Remove Salmon and PubSubHubbub (#11205)
* Remove Salmon and PubSubHubbub endpoints

* Add error when trying to follow OStatus accounts

* Fix new accounts not being created in ResolveAccountService
2019-07-06 23:26:16 +02:00
Eugen Rochko f7f23b4a19 Add audio uploads (#11123)
* Add audio uploads

Fix #4827

Accept uploads of OGG, WAV, FLAC, OPUS and MP3 files, and converts
them to OGG. Media attachments get a new `audio` type. In the UI,
audio uploads are displayed identically to video uploads.

* Improve code style
2019-06-19 23:42:38 +02:00
ThibG 14f6ce2885 Record account suspend/silence time and keep track of domain blocks (#10660)
* Record account suspend/silence time and keep track of domain blocks

* Also unblock users who were suspended/silenced before dates were recorded

* Add tests

* Keep track of suspending date for users suspended through the CLI

* Show accurate number of accounts that would be affected by unsuspending an instance

* Change migration to set silenced_at and suspended_at

* Revert "Also unblock users who were suspended/silenced before dates were recorded"

This reverts commit a015c65d2d1e28c7b7cfab8b3f8cd5fb48b8b71c.

* Switch from using suspended and silenced to suspended_at and silenced_at

* Add post-deployment migration script to remove `suspended` and `silenced` columns

* Use Account#silence! and Account#suspend! instead of updating the underlying property

* Add silenced_at and suspended_at migration to post-migration

* Change account fabricator to translate suspended and silenced attributes

* Minor fixes

* Make unblocking domains always retroactive
2019-05-14 19:05:02 +02:00
Eugen Rochko f1bc90ab50 Rename :poll to :preloadable_poll and :owned_poll to :poll on Status (#10401)
Also, fix some n+1 queries

Resolve #10365
2019-03-28 04:44:59 +01:00
Eugen Rochko 3ad3223b46 Fix detailed poll validation errors not being returned in the API (#10261)
No more "Owned poll is invalid"
2019-03-15 13:36:38 +01:00
ThibG 3a92885a86 Support pushing and receiving updates to poll tallies (#10209)
* Process incoming poll tallies update

* Send Update on poll vote

* Do not send Updates for a poll more often than once every 3 minutes

* Include voters in people to notify of results update

* Schedule closing poll worker on poll creation

* Add new notification type for ending polls

* Add front-end support for ended poll notifications

* Fix UpdatePollSerializer

* Fix Updates not being triggered by local votes

* Fix tests failure

* Fix web push notifications for closing polls

* Minor cleanup

* Notify voters of both remote and local polls when those close

* Fix delivery of poll updates to mentioned accounts and voters
2019-03-11 00:49:31 +01:00
ThibG f821eca3b3 Correctly make polls and media mutually exclusive (#10141) 2019-03-04 00:40:21 +01:00
Eugen Rochko 230a012f00 Add polls (#10111)
* Add polls

Fix #1629

* Add tests

* Fixes

* Change API for creating polls

* Use name instead of content for votes

* Remove poll validation for remote polls

* Add polls to public pages

* When updating the poll, update options just in case they were changed

* Fix public pages showing both poll and other media
2019-03-03 22:18:23 +01:00
ysksn bcfff65195 Create Redisable#redis (#9633)
* Create Redisable

* Use #redis instead of Redis.current
2019-02-02 19:11:38 +01:00
ThibG e2a5be6e9a Prevent posting toots with media attachments from someone else (#9921) 2019-01-26 23:59:39 +01:00
ThibG 061feb63ed Fix scheduled toot with media immediately creating a toot (#9894)
* Add test for not persisting status when attaching media to scheduled toot

* Prevent status used for validation from being persisted to the database

Fixes #9893

Thanks to tateisu for the help investigating this.
2019-01-21 20:03:04 +01:00
Eugen Rochko 6ca9015789 Fix error when scheduled_at attribute is malformed (#9866) 2019-01-19 22:01:01 +01:00
Eugen Rochko 1cbdf8d218 Fix wrong param name in scheduled statuses and return params in API (#9725)
The database column and API param are called in_reply_to_id, not
in_reply_to_status_id, so it makes no sense to encode it that way
2019-01-06 12:03:27 +01:00
Eugen Rochko a49d43d112 Add scheduled statuses (#9706)
Fix #340
2019-01-05 12:43:28 +01:00