Commit Graph

42 Commits (e15befebbd288faeec55ef6ad323d106f4ec57e1)

Author SHA1 Message Date
Christian Schmidt 8cdc148167
Handle invalid visibility (#31571) 1 month ago
Christian Schmidt a5bbe83dfd
media_ids is an array of strings (#31709) 1 month ago
Christian Schmidt 491033c86c
Reject status creation with invalid `media_ids` parameter (#31681) 1 month ago
Daniel M Brasil 77c2216e47
fix: Return HTTP 422 when scheduled status time is less than 5 minutes (#30584) 4 months ago
Matt Jankowski c61e356475
Add `Status::MEDIA_ATTACHMENTS_LIMIT` configuration constant (#30433) 5 months ago
Claire 91ca90e25b
Fix Idempotency-Key ignored when scheduling a post (#30084) 6 months ago
Matt Jankowski 6262ceeb70
Fix `RSpec/DescribedClass` cop (#29472) 7 months ago
Matt Jankowski 469028b6d3
Remove unneeded `type: :service` from spec/services files (#29304) 7 months ago
Matt Jankowski 4b7f04e3ea
Reduce `RSpec/MultipleExpectations` in post_status_service spec (#29225) 8 months ago
Matt Jankowski 0df86d77fd
Reduce `RSpec/ExampleLength` in PostStatusService spec example (#29105) 8 months ago
Matt Jankowski bcd0171e5e
Fix `Lint/UselessAssignment` cop (#27472) 1 year ago
Matt Jankowski 658742b3cd
Fix `Lint/AmbiguousBlockAssociation` cop (#25921) 1 year ago
Matt Jankowski 05f9e39b32
Fix `RSpec/VerifiedDoubles` cop (#25469) 1 year ago
Matt Jankowski c42591356d
Fix `RSpec/DescribedClass` cop (#25104) 1 year ago
Matt Jankowski b896b16cb3
Fix RSpec/PredicateMatcher cop (#25102) 1 year ago
Nick Schonning 84cc805cae
Enable Style/FrozenStringLiteralComment for specs (#23790) 2 years ago
Nick Schonning 5116347eb7
Autofix Rubocop RSpec/BeEq (#23740) 2 years ago
Nick Schonning 65ba0d92ef
Enable Rubocop RSpec/NotToNot (#23723) 2 years ago
Nick Schonning 81ad6c2e39
Autofix Rubocop Style/StringLiterals (#23695) 2 years ago
Nick Schonning c38bd17657
Autofix Rubocop Style/TrailingCommaInArguments (#23694) 2 years ago
Nick Schonning 936204b9ea
Autofix Rubocop Style/NestedParenthesizedCalls (#23646) 2 years ago
Claire d6930b3847
Add API parameter to safeguard unexpect mentions in new posts (#18350) 2 years ago
Claire 216570ad98
Fix scheduled statuses decreasing statuses counts (#16791)
* Add tests

* Fix scheduled statuses decreasing statuses counts

Fixes #16774
3 years ago
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.
5 years ago
Eugen Rochko 81cc86bb1f
Fix media attachments without file being uploadable (#12562)
Fix #12554
5 years ago
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
5 years ago
ThibG e2a5be6e9a Prevent posting toots with media attachments from someone else (#9921) 6 years ago
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.
6 years ago
Eugen Rochko a49d43d112
Add scheduled statuses (#9706)
Fix #340
6 years ago
ThibG 5f387995d9 Limit maximum visibility of local silenced users to unlisted (#9583)
Fixes #9580
6 years ago
valerauko db9aea34de Ensure replied-to is a status not a boost (#9129)
* Ensure replied-to is a status not a boost

* Consider case of not a reply

* Add test case for replying to boost

* Move reblog-reply resolution to model

* Remove unnecessary comment
6 years ago
Eugen Rochko cb5b5cb5f7
Slightly reduce RAM usage (#7301)
* No need to re-require sidekiq plugins, they are required via Gemfile

* Add derailed_benchmarks tool, no need to require TTY gems in Gemfile

* Replace ruby-oembed with FetchOEmbedService

Reduce startup by 45382 allocated objects

* Remove preloaded JSON-LD in favour of caching HTTP responses

Reduce boot RAM by about 6 MiB

* Fix tests

* Fix test suite by stubbing out JSON-LD contexts
7 years ago
Yamagishi Kazutoshi b21db9bbde Using double splat operator (#5859) 7 years ago
Akihiko Odaki 48d77ea1eb Fix filterable_languages method of SettingsHelper (#4966) 7 years ago
Eugen Rochko b7370ac8ba ActivityPub delivery (#4566)
* Deliver ActivityPub Like

* Deliver ActivityPub Undo-Like

* Deliver ActivityPub Create/Announce activities

* Deliver ActivityPub creates from mentions

* Deliver ActivityPub Block/Undo-Block

* Deliver ActivityPub Accept/Reject-Follow

* Deliver ActivityPub Undo-Follow

* Deliver ActivityPub Follow

* Deliver ActivityPub Delete activities

Incidentally fix #889

* Adjust BatchedRemoveStatusService for ActivityPub

* Add tests for ActivityPub workers

* Add tests for FollowService

* Add tests for FavouriteService, UnfollowService and PostStatusService

* Add tests for ReblogService, BlockService, UnblockService, ProcessMentionsService

* Add tests for AuthorizeFollowService, RejectFollowService, RemoveStatusService

* Add tests for BatchedRemoveStatusService

* Deliver updates to a local account to ActivityPub followers

* Minor adjustments
7 years ago
Eugen Rochko 8b5179d006 Fix #2402 - Add Idempotency-Key header to PostStatusService that prevents (#2419)
duplicates. Web UI regenerates UUID for that header every time the compose
form is changed or successfully submitted

Also, fix Farsi i18n overwriting the English one
8 years ago
Matt Jankowski 297c11dba2 Language detection refactor (#2099)
* Extract detect_language to separate class

* Use default locale, not just en

* Add spec to confirm that whatlanguage cant identify empty string

* Allow account locale to override default in language detector

* PostStatusService supplies an account to detect language
8 years ago
Chad Pytel ad5ddd5e95 Use I18n for media attachment validation errors
These are currently user facing errors, but are not localized. This adds the
ability for these messages to be localized.
8 years ago
Chad Pytel 13c0077003 Add specs for PostStatusService
This implements all pending specs, and adds additional coverage for the
following functionality:

* Normal status creation
* Creating a reply status
* Creating a sensitive status
* Creating a status with spoiler text
* A status with no spoiler text gets an empty string for spoiler text
* Creating a status with custom visibility
* Creating a status for an application
* Processing mentions
* Processing Hashtags
* Pinging PuSH hubs
* Crawling links
* Attaching media
8 years ago
Chad Pytel 38bec79811 Add specs for media attachment validations
There are currently not specs for the two media validations that are performed
by `PostStatusService`. This adds specs for the validations that ensure that you
cannot attach more than four files, and that a status cannot have both image and
video attachments.
8 years ago
Eugen Rochko 3b4e04dc32 Fixing some bugs, adding pending test examples 9 years ago
Eugen Rochko 71fe24096c Adding a Mention model, test stubs 9 years ago