mastodon/app/javascript/mastodon
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.
2017-11-28 15:00:35 +01:00
..
actions Allow hiding of reblogs from followed users (#5762) 2017-11-28 15:00:35 +01:00
components Allow hiding of reblogs from followed users (#5762) 2017-11-28 15:00:35 +01:00
containers Optional notification muting (#5087) 2017-11-15 03:56:41 +01:00
features Allow hiding of reblogs from followed users (#5762) 2017-11-28 15:00:35 +01:00
locales Refactor KeyboardShortcuts component (#5835) 2017-11-28 14:32:27 +01:00
middleware Suppress type error(not a function) on calling fastSeek (#5452) 2017-10-18 17:13:51 +02:00
reducers Allow hiding of reblogs from followed users (#5762) 2017-11-28 15:00:35 +01:00
selectors Profile redirect notes (#5746) 2017-11-18 19:39:02 +01:00
service_worker Refactor Web::PushSubscription, remove welcome message (#4524) 2017-09-01 13:35:23 +02:00
store refactor: Make all reducers sync (#4125) 2017-07-09 12:16:08 +02:00
.gitkeep Replace sprockets/browserify with Webpack (#2617) 2017-05-03 02:04:16 +02:00
api.js Improve eslint rules (#3147) 2017-05-20 17:31:47 +02:00
base_polyfills.js Enable ESLint rules import/* (#5414) 2017-10-16 11:12:09 +02:00
extra_polyfills.js Add object-fit polyfill for Edge (#4182) 2017-07-14 01:59:34 +02:00
initial_state.js Refactor initial state: "me" (#5563) 2017-10-31 11:27:48 +09:00
is_mobile.js Change mobile layout breakpoint from 1024px to 630px (#5063) 2017-09-24 01:25:07 +02:00
link_header.js Improve eslint rules (#3147) 2017-05-20 17:31:47 +02:00
load_polyfills.js Load extra polyfills when isIntersecting is undefined (#4469) 2017-07-31 19:40:20 +02:00
main.js Enable ESLint rules import/* (#5414) 2017-10-16 11:12:09 +02:00
performance.js Upgrade to React 16 (#5119) 2017-09-30 04:29:56 +02:00
ready.js Do not load unnecessary script files (#4193) 2017-07-14 11:08:56 +02:00
rtl.js Improve RTL detection (#3682) 2017-06-10 15:06:50 +02:00
scroll.js Scroll smoothly to the right (#4735) 2017-08-29 17:06:19 +02:00
stream.js reusable-streaming (#5709) 2017-11-15 16:04:15 +01:00
test_setup.js Replace JavaScript Testing Framework from Mocha to Jest (#5412) 2017-10-16 09:33:08 +02:00
uuid.js Replace sprockets/browserify with Webpack (#2617) 2017-05-03 02:04:16 +02:00
web_push_subscription.js Remove eslint-disable comments (#4681) 2017-08-24 12:15:36 +02:00