You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mastodon/app/controllers/api/v1
aschmitz eeaec39888 Allow hiding of reblogs from followed users (#5762)
* Allow hiding of reblogs from followed users

This adds a new entry to the account menu to allow users to hide
future reblogs from a user (and then if they've done that, to show
future reblogs instead).

This does not remove or add historical reblogs from/to the user's
timeline; it only affects new statuses.

The API for this operates by sending a "reblogs" key to the follow
endpoint. If this is sent when starting a new follow, it will be
respected from the beginning of the follow relationship (even if
the follow request must be approved by the followee). If this is
sent when a follow relationship already exists, it will simply
update the existing follow relationship. As with the notification
muting, this will now return an object ({reblogs: [true|false]}) or
false for each follow relationship when requesting relationship
information for an account. This should cause few issues due to an
object being truthy in many languages, but some modifications may
need to be made in pickier languages.

Database changes: adds a show_reblogs column (default true,
non-nullable) to the follows and follow_requests tables. Because
these are non-nullable, we use the existing MigrationHelpers to
perform this change without locking those tables, although the
tables are likely to be small anyway.

Tests included.

See also <https://github.com/glitch-soc/mastodon/pull/212>.

* Rubocop fixes

* Code review changes

* Test fixes

This patchset closes #648 and resolves #3271.

* Rubocop fix

* Revert reblogs defaulting in argument, fix tests

It turns out we needed this for the same reason we needed it in muting:
if nil gets passed in somehow (most usually by an API client not passing
any value), we need to detect and handle it.

We could specify a default in the parameter and then also catch nil, but
there's no great reason to duplicate the default value.
7 years ago
..
accounts Non-Serial ("Snowflake") IDs (#4801) 7 years ago
apps Fix #5104 - GET /api/v1/apps/verify_credentials to confirm app works (#5112) 7 years ago
lists Lists (#5703) 7 years ago
statuses Pinned statuses (#4675) 8 years ago
timelines Lists (#5703) 7 years ago
accounts_controller.rb Allow hiding of reblogs from followed users (#5762) 7 years ago
apps_controller.rb Fix #5104 - GET /api/v1/apps/verify_credentials to confirm app works (#5112) 7 years ago
blocks_controller.rb Fix pagination in Api::V1::BlocksController (#5285) 7 years ago
custom_emojis_controller.rb Improve admin UI for custom emojis, add copy/disable/enable (#5231) 7 years ago
domain_blocks_controller.rb Clean up for api/base controller (#3629) 8 years ago
favourites_controller.rb Merge queries in Api::V1::FavouritesController (#4359) 8 years ago
follow_requests_controller.rb Refactor JSON templates to be generated with ActiveModelSerializers instead of Rabl (#4090) 8 years ago
follows_controller.rb Fix POST /api/v1/follows error when already following (#4878) 8 years ago
instances_controller.rb Refactor JSON templates to be generated with ActiveModelSerializers instead of Rabl (#4090) 8 years ago
lists_controller.rb Lists (#5703) 7 years ago
media_controller.rb Add ability to specify alternative text for media attachments (#5123) 7 years ago
mutes_controller.rb Refactor JSON templates to be generated with ActiveModelSerializers instead of Rabl (#4090) 8 years ago
notifications_controller.rb Refactor JSON templates to be generated with ActiveModelSerializers instead of Rabl (#4090) 8 years ago
reports_controller.rb Add moderator role and add pundit policies for admin actions (#5635) 7 years ago
search_controller.rb Filter searched toots to be consistent with blocking behaviors (#5383) 7 years ago
statuses_controller.rb Make PreviewCard records reuseable between statuses (#4642) 8 years ago
streaming_controller.rb Clean up for api/base controller (#3629) 8 years ago