Commit Graph
100 Commits
Author SHA1 Message Date
ThibGandEugen Rochko aeb124491d Reject existing Follow in addition to sending a Block (#9811)
Mastodon expects remote servers to remove follow relationships upon receiving
a Block. However, the spec only evokes Block activities in a C2S context, never
in a S2S context.

This PR, in addition to federating the Block, explicitly sends a Reject for any
affected follow relationship, which makes a bit more sense with regards to the
spec.
2019-01-18 15:57:19 +01:00
ThibGandEugen Rochko 75b1488cf4 Add tombstones for remote statuses (#9830)
* Add Tombstone model to remember object deletion

* Do not recreate a status if it has been deleted

* Record Tombstone for remote deleted items

Also, only record deleted items from same-host actors

* Clear an user's tombstones when their key change
2019-01-18 15:56:55 +01:00
ThibGandEugen Rochko 3b3a4d8a17 Fix public hashtag timeline width on mobile, fix scrollbar width compensation (#9824)
* Fix hashtag timeline width being potentially larger than window width

* Add automatic computation of scrollbar width
2019-01-16 20:36:10 +01:00
ThibGandEugen Rochko a4f07bad95 Reduce chances of race conditions when processing deleted toots (#9815)
* Reduce chances of race conditions when processing deleted toots

* Prevent race condition when processing deleted toots
2019-01-16 15:42:00 +01:00
ThibGandEugen Rochko 6cfb357940 Make hashtag search results link to the hashtag URL (#9810)
Currently, middle-clicking on a hashtag search result will open a new
instance of the WebUI, which is inconsistent with middle-clicking on
an account result, or a hashtag in a toot.
2019-01-14 23:29:21 +01:00
ThibGandEugen Rochko c5b8824a3e Fix hashtag timeline on mobile (#9806)
Instead of forcing 90vh for the scrollable part of the timeline's height as
in #9781 (which may be off), use `display: flex`, exactly like on desktop.
2019-01-14 17:30:31 +01:00
ThibGandEugen Rochko 2648645d05 Display a double reply arrow on public pages for toots that are replies (#9808) 2019-01-14 17:29:04 +01:00
ThibGandEugen Rochko 4fb94c758e Add attachment list fallback to public pages (#9780)
* Add attachment list fallback to public pages

Fixes #6714

* Refactor attachments lists
2019-01-13 09:23:54 +00:00
ThibGandEugen Rochko c3a657223f Hide CWed content in notifications and fix sensitive images without CWs (#9778)
Fixes #9634
2019-01-11 07:29:17 +00:00
ThibGandEugen Rochko 70801b850c Postpone scroll-to-detailed status after react components are loaded (#9773) 2019-01-10 15:13:30 +01:00
ThibGandEugen Rochko 5104b61b6b Downgrade react-redux-loading-bar to 4.0.8 to fix media modal (#9771) 2019-01-10 15:13:00 +01:00
ThibGandEugen Rochko 28b482874a Improvements to signature verification (#9667)
* Refactor signature verification a bit

* Rescue signature verification if recorded public key is invalid

Fixes #8822

* Always re-fetch AP signing key when HTTP Signature verification fails

But when the account is not marked as stale, avoid fetching collections and
media, and avoid webfinger round-trip.

* Apply stoplight to key/account update as well as initial key retrieval
2019-01-07 21:45:13 +01:00
ThibGandEugen Rochko 6f9a7bd02c Add quick links to the admin interface in the WebUI (#8545)
* Allow to show a specific status in the admin interface

* Let the front-end know the current account is a moderator

* Add admin links to status and account menus

If the current logged-in user is an admin, add quick links to the admin
interface in account and toot dropdown menu. Suggestion by @ashkitten

* Use @statuses.first instead of @statuses[0]
2019-01-04 13:10:43 +01:00
ThibGandEugen Rochko eb3b9e22bd Fix CircleCI (#9695) 2019-01-02 20:48:22 +01:00
ThibGandEugen Rochko 70be301d69 Ensure blocked user unfollows blocker if Block/Undo Block are processed out of order (#9687)
* Ensure blocked user unfollows blocker if Block/Undo Block are processed out of order

* Add specs for Block causing unfollow and for out-of-order Block + Undo
2019-01-02 01:12:02 +01:00
ThibGandEugen Rochko f04f3ee436 Fix icon alignment in onboarding interaction screen (#9686) 2019-01-01 16:19:51 +01:00
ThibGandEugen Rochko 1d4215be77 Restore ReplyDistributionWorker to allow existing jobs to be processed (#9676) 2019-01-01 13:43:11 +01:00
ThibGandEugen Rochko 6fb6a53938 Avoid duplicate work by merging ReplyDistributionWorker into DistributionWorker (#9660) 2018-12-30 19:00:04 +01:00
ThibGandEugen Rochko b2f4114550 Do not ignore federated reports targetting already-reported accounts (#9534) 2018-12-30 18:58:51 +01:00
ThibGandEugen Rochko 6a7a36fcdd Immediately go back in browser history upon successfully sending toot (#9663)
Avoids possible misleading delay before redirection during which the
composer would be cleared and redrawn.
2018-12-30 18:58:25 +01:00
ThibGandEugen Rochko e74c99edf5 Fix crash when clearing uninitialized timeline (#9662) 2018-12-30 18:57:39 +01:00
ThibGandEugen Rochko 290932602b Reduce usage of LD signatures (#9659)
* Do not LDS-sign Follow, Accept, Reject, Undo, Block

* Do not use LDS for Create activities of private toots

* Minor cleanup

* Ignore unsigned activities instead of misattributing them

* Use status.distributable? instead of querying visibility directly
2018-12-30 09:48:59 +01:00
ThibGandEugen Rochko 4423999609 Fix account unsilencing and unsuspension (#9637)
Fix regression from 3c033c4352
2018-12-26 19:16:15 +01:00
ThibGandEugen Rochko 5f387995d9 Limit maximum visibility of local silenced users to unlisted (#9583)
Fixes #9580
2018-12-24 19:06:14 +01:00
ThibGandEugen Rochko e25947db4a Sanitize and sandbox toot embeds (#9552) 2018-12-23 02:16:35 +01:00
ThibGandEugen Rochko a6079a42b6 Fix composer not getting focus after reply confirmation dialog (#9602)
The modal-handling code gives back focus to the element focused when the
modal opened. However, in the case of reply confirmation, it would do so
*after* the composer code itself requested focus.
2018-12-21 18:52:41 +01:00
ThibGandEugen Rochko 8389b496ba Fix unnecessary loadMore calls when the end of a timeline has been reached (#9581)
Fixes #9568
2018-12-19 22:23:16 +01:00
ThibGandEugen Rochko e70e496e29 Clean up dead code in public timeline code (#9565) 2018-12-18 22:00:18 +01:00
ThibGandEugen Rochko e709b8da0d Ignore low-confidence CharlockHolmes guesses when parsing link cards (#9510)
* Add failing test for windows-1251 link cards

* Ignore low-confidence CharlockHolmes guesses

Fixes #9466

* Fix no method error when charlock holmes cannot detect charset
2018-12-17 19:19:45 +01:00
ThibGandEugen Rochko 4ede51743e Minor scrollable list fixes (#9551)
* Make sure loading indicator has enough vertical space

* Respect reduce_motion setting for loading indicator
2018-12-17 17:02:59 +01:00
ThibGandEugen Rochko 4297de34cf Split out is_changing_upload from is_submitting (#9536)
There is no reason to disable the composer textarea when some media metadata
is being modified, nor is there any reason to focus the textarea when some
media metadata has been modified (prevents clicking one image's description
field right after having modified another).
2018-12-16 21:17:56 +01:00
ThibGandEugen Rochko aa7a8a3031 When posting in mobile mode, go back to previous history location (#9502)
Fixes #7112
2018-12-14 20:35:26 +01:00
ThibGandEugen Rochko 7c48688d85 Make avatar and headers respect auto_play_gif (#9515)
* Do not animate account header art if user's GIF autoplay setting is off

Fixes #9472

* Honour currently logged-in user's GIF autoplay setting for account avatars

Fixes #9467

* Fix avatar display on some public pages when data is stored on a different host

* Use ternary operator instead of if/else for avatar/header URL
2018-12-14 20:34:18 +01:00
ThibGandEugen Rochko 11a91592aa Restore profile links in /admin/accounts (#9494)
Fixes #9431
2018-12-14 01:47:50 +01:00
ThibGandEugen Rochko c58c00651b Fix padding on select elements in preferences (#9517)
Add right-padding to select elements to take the up/down arrows into
account.

Thanks Tixie for finding the issue!
2018-12-14 01:44:39 +01:00
ThibGandEugen Rochko f20c0b8507 Fix timeline pagination in the WebUI (#9516)
The `hasMore` property of timelines in redux store was set whenever an API
request returned only one page of results, *even* if the query only requested
newer statuses (using `since_id`), causing `hasMore` to be incorrectly set to
false whenever fetching new toots in a timeline, which happens each time
an account's timeline or media gallery is visited.
2018-12-14 01:41:38 +01:00
ThibGandEugen Rochko 55abff8af7 Various fixes to scrollable lists and media gallery (#9501)
* Always use the scrollable class for the ScrollList component

Fixes #9499 as well as empty timelines' scrollbar “blinking”
between loading state and empty state.

* Do not display empty message when the list is known to have more elements

Fixes #9500

* Fix LoadMore usage in account media gallery

(Even though that codepath is probably never actually used…)

* Make account media gallery more consistent with account timeline

Fixes #9498

Display “load more” more consistently, add a loading indicator on first load.

* Fix “load more” button when no data has been fetched
2018-12-12 22:32:44 +01:00
ThibGandEugen Rochko cf6ee4ff24 Add admin ability to remove an user's header image (#9495)
* Fix markup in admin/accounts/:id table for avatar

* Add admin ability to remove an user's header image
2018-12-11 19:28:03 +01:00
ThibGandEugen Rochko 720daa8143 Add instance-wide setting to disable profile directory (#9497)
* Add instance-wide setting to disable profile directory

Fixes #9496

When the profile directory is disabled:
- The “discoverable” setting is hidden from users
- The “profile directory” link is not shown on public pages
- /explore returns 404

* Move Setting.profile_directory check to a before_action filter
2018-12-11 19:18:29 +01:00
ThibGandEugen Rochko 3f12c07ff5 Use same CORS policy for /@:username and /users/:username (#9485)
Fixes #8189

rack-cors being called before the application router, it does not follow
the redirection, and we need a separate rule for /users/:username.
2018-12-10 21:39:47 +01:00
ThibGandEugen Rochko 81bda7d67c Add setting to not aggregate reblogs (#9248)
* Add setting to not aggregate reblogs

Fixes #9222

* Handle cases where user is nil in add_to_home and add_to_list

* Add hint for setting_aggregate_reblogs option

* Reword setting_aggregate_reblogs label
2018-12-09 13:03:01 +01:00
ThibGandEugen Rochko 1a22eff1e0 Attempt fixing deadlocks by moving account stats update outside transaction (#9437)
* Use `update_column` instead of `update_attribute` in callback

`update_attribute` would normally cause callbacks to be called.
Called from a callback, it seems to stop further callbacks from executing.

`update_column` does the same work, but without calling callbacks or
preventing other callbacks from executing.

* Fix deadlocks by moving account stats update outside transaction
2018-12-05 22:51:12 +01:00
ThibGandEugen Rochko e88c6a5c3c Fix thread depth computation in statuses_controller (#9426)
* Add test that should currently fail

* Fix depth computation (will still fail if statuses have been filtered out)

* Fix handling of broken threads
2018-12-05 02:12:29 +01:00
ThibGandEugen Rochko 84e5ed43e7 Preload common JSON-LD contexts (#9412)
Fixes #9411
2018-12-02 16:46:13 +01:00
ThibGandEugen Rochko 5648b30d6c Fix last_status parameter for notifications and conversations (#9407) 2018-12-01 18:36:41 +01:00
ThibGandEugen Rochko fa9f28f52d Swap avatar and header input fields in profile page (#9271)
Fixes #9211
2018-11-29 02:56:09 +01:00
ThibGandEugen Rochko 395615d9f3 Allow hyphens in the middle of remote user names (#9345)
Fixes #9309

This only allows hyphens in the middle of a username, much like dots,
although I don't have a compelling reason to do so other than keeping
the changes minimal.
2018-11-27 12:28:01 +01:00
ThibGandEugen Rochko 466e3d710c Include replies to list owner and replies to list members in list statuses (#9324) 2018-11-21 17:02:58 +01:00
ThibGandEugen Rochko c875f19673 Fix race condition causing shallow status with only a "favourited" attribute (#9272)
Fixes #9231
2018-11-13 14:58:14 +01:00
ThibGandEugen Rochko bbd8fdd185 Perform deep comparison for card data when receiving new props (#9270)
Fixes #9226
2018-11-12 18:17:50 +01:00
ThibGandEugen Rochko 7f5a4be580 Fix emoji update date processing (#9255) 2018-11-10 23:59:51 +01:00
ThibGandEugen Rochko 9b89c62d43 Check that twitter:player is valid before using it (#9254)
Fixes #9251
2018-11-10 20:42:04 +01:00
ThibGandEugen Rochko 08b3de4d5e Remove unused computation of reblog references from updateTimeline (#9244) 2018-11-09 17:43:25 +01:00
ThibGandEugen Rochko a03d506626 Fix Pleroma mentions being fetched as preview cards (#9158) 2018-10-30 15:02:24 +01:00
ThibGandEugen Rochko 33a71e8f7c Do not hide boost notifications from followed people with hidden boosts (#9147)
* Do not hide boost notifications from followed people with hidden boosts

Not displaying boosts from a followed user in the Home timeline and not
having notifications when they reblog your own content are two very
separate concerns, tying them together seem counter-intuitive and unwanted.

* Update specs accordingly
2018-10-30 00:47:31 +01:00
ThibGandEugen Rochko a90b569350 When searching for an emoji with multiple separators, consider the full input (#9124)
e.g., typing “blob_cat_p” used to search for “blob” and “cat”, but not
“blob_cat_p”, which means “blob_cat_patpat” is very unlikely to show up,
although it is likely what the user wanted to type in the first place.
2018-10-27 22:32:54 +02:00
ThibGandEugen Rochko 215e649391 Fix styling in /auth/edit (#9117) 2018-10-26 22:49:17 +02:00
ThibGandEugen Rochko e53cc673e7 Ignore invalid hashtags on remote statuses instead of rejecting them (#9118)
Fixes #9115
2018-10-26 22:48:35 +02:00
ThibGandEugen Rochko 82e7988afc Fix missing mention argument when processing incoming Create activities (#9114)
* Fix missing `mention` argument when processing incoming Create activities

* Fix typo (param → params)
2018-10-26 12:59:59 +02:00
ThibGandEugen Rochko 7fee968e9f Do not fetch preview card for mentioned users (#6934) 2018-10-25 18:13:19 +02:00
ThibGandEugen Rochko 84cf78da8a Fix og:url on toots' public view (#9047)
Fixes #9045
2018-10-21 22:52:10 +02:00
ThibGandEugen Rochko 007f7690fa Fix fav/boosts hotkeys not working on detailed statuses (#9006) 2018-10-18 19:52:00 +02:00
ThibGandEugen Rochko adb06baef6 Handle global hotkeys even when no element has focus (#8998)
This fixes hotkeys not working when pressing the column
“back” button, for instance.
2018-10-17 16:56:16 +02:00
ThibGandEugen Rochko 8ab081ec32 Add manifest_src to CSP, add blob to connect_src (#8967) 2018-10-12 19:07:30 +02:00
ThibGandEugen Rochko 2d27c11061 Set Content-Security-Policy rules through RoR's config (#8957)
* Set CSP rules in RoR's configuration

* Override CSP setting in the embed controller to allow frames
2018-10-11 20:35:46 +02:00
ThibGandEugen Rochko 25744d43b0 Ensure only toots from the reported users are reported (#8916) 2018-10-07 19:45:40 +02:00
ThibGandEugen Rochko 42aecb4c13 Add a confirmation dialog when hitting reply and the compose box isn't empty (#8893)
* Add a confirmation dialog when hitting reply and the compose box isn't empty

Fixes #878

* Performance improvement
2018-10-05 18:44:44 +02:00
ThibGandEugen Rochko ba444797d2 Fix handling of ActivityPub activities lacking some attributes (#8864) 2018-10-03 23:44:13 +02:00
ThibGandEugen Rochko c39183cc62 Refactor active_nav_class for use with multiple paths (#8757) 2018-09-23 20:42:13 +02:00
ThibGandYamagishi Kazutoshi 0aa9c05744 Fix Spanish locale broken due to translated variable name (#8754) 2018-09-23 09:56:28 +09:00
ThibGandEugen Rochko 05f90e3695 Adjust beforeUnload conditions (#8746)
Fixes #8701
2018-09-21 18:54:17 +02:00
ThibGandEugen Rochko c946ba3fae Add rel=me to moved accounts' link (#8742) 2018-09-20 22:53:30 +02:00
ThibGandEugen Rochko f8b54d229f Fix “Toots” tab highlighting for replies and media timelines (#8715) 2018-09-18 03:57:13 +02:00
ThibGandEugen Rochko 9b32898e3c Unconditionally re-encode locally-uploaded images to strip metadata (#8714)
This strips metadata on file upload by re-encoding the files, at the cost
of possible slight image quality decrease and processing resources.
2018-09-17 20:24:46 +02:00
ThibGandEugen Rochko 4959ead07c Fix media description in various media modals (#8678) 2018-09-13 20:31:59 +02:00
ThibGandEugen Rochko f8160b68b3 Only focus first element of dropdown menus if using keyboard (#8679)
* Only focus first item of dropdown if it was opened via keyboard

* Improve keyboard VS mouse navigation of dropdown menus
2018-09-13 20:31:33 +02:00
ThibGandEugen Rochko 09a87b2cdb Auto-focus emoji picker's search field (#8688)
Fixes #6056
2018-09-13 20:31:11 +02:00
ThibGandEugen Rochko 661a89ea74 Autofocus comment textarea in report modal (#8689) 2018-09-13 15:27:29 +02:00
ThibGandEugen Rochko 7fa4144d48 Fix building assets in test environment (#8691)
Webpacker (Ruby wrapper to webpack) uses RAILS_ENV-based environments while
the javascript configuration for webpack re-reads this configuration file using
the NODE_ENV environment variable. This means that when RAILS_ENV=test, running
“assets:precompile” compiled the production packs in “public/packs” while
webpacker expects them in “public/packs-test”. This causes Ruby to recompile
them on-the-fly, possibly leading to race conditions in parallel_tests.

This changes:
- Disables on-the-fly compilation in test environment
- Changes the javascript part to read the correct environment
2018-09-13 15:18:47 +02:00
ThibGandEugen Rochko bda0f7ac73 Add a few black emojis that are to have a white outline (#8597) 2018-09-10 18:26:47 +02:00
ThibGandEugen Rochko bd9e47e9be Handle relative URLs when fetching OEmbed/OpenGraph cards (#8669) 2018-09-10 18:26:28 +02:00
ThibGandEugen Rochko 0c5db3163a Fix dropdown arrow position (#8637) 2018-09-07 01:18:46 +02:00
ThibGandEugen Rochko fdda332e4d Update docker config and move some workers to different queues (#8345)
* Reorder docker-compose's sidekiq queues to match config/sidekiq.yml

* Make the ̀“mailers” queue higher priority than “pull”
2018-09-02 16:13:06 +02:00
ThibGandEugen Rochko 45c0f5433c Do not show follow button on moved or memorial accounts (#8546)
This restores the logic from before the public profile redesign. Fixes #8503
2018-08-31 20:33:01 +02:00
ThibGandEugen Rochko 0b62585748 Self-notify on accepting follow requests (#8541) 2018-08-31 15:17:31 +02:00
ThibGandEugen Rochko 7786e1357b Only display web push notifications after API call (fixes #7902) (#8396)
* Only display web push notifications after API call (fixes #7902)

* Decode then truncate instead of truncating then decoding in webpush serializer
2018-08-23 21:44:27 +02:00
ThibGandEugen Rochko 43b8df3228 Update state when opened dropdown is unmounted (fixes #8397) (#8398) 2018-08-23 20:43:27 +02:00
ThibGandEugen Rochko 63484ee17a Do not check for file existence when serializing ActivityPub actor (#8386)
When serializing an ActivityPub actor, Mastodon checks for the existence
of the avatar/header files. This is not necessary, only check if avatar/header
is set.

https://github.com/thoughtbot/paperclip/blob/fd8bf49d3895de2904b43f95d11af0736fbd0f5b/README.md#checking-a-file-exists
2018-08-23 16:39:22 +02:00
ThibGandEugen Rochko 42573b76f1 Do not crash if remote custom emoji does not define updated date (fixes #8376) (#8377) 2018-08-23 00:27:58 +02:00
ThibGandEugen Rochko 56f882aed6 Avoid deleted attributes when building a Status from action log (fixes #8371) (#8373) 2018-08-22 20:55:50 +02:00
ThibGandEugen Rochko f06fa09962 Revert to using Paperclip's filesystem storage, and fix dangling records in remove_remote (#8339)
* Fix uncaching worker

* Revert to using Paperclip's filesystem backend instead of fog-local

fog-local has lots of concurrency issues, causing failure to delete files,
dangling file records, and spurious errors UncacheMediaWorker
2018-08-21 17:53:01 +02:00
ThibGandEugen Rochko 8ac5e651e1 Upgrade doorkeeper to 4.4.2 (#8321) 2018-08-20 22:42:02 +02:00
ThibGandEugen Rochko b34d6238cb Add API endpoint to list featured accounts (fixes #8315) (#8317) 2018-08-20 18:46:04 +02:00
ThibGandEugen Rochko 5fbf12bbb8 Skip pagination logic entirely for pinned toots (fixes #8302) (#8310) 2018-08-20 13:32:43 +02:00
ThibGandEugen Rochko 28163528e5 Don't filter own toots (fixes #8289) (#8298) 2018-08-19 18:44:18 +02:00
ThibGandEugen Rochko abc5548cca Do not process outgoing mentions to suspended accounts (#8272) 2018-08-18 19:42:13 +02:00
ThibGandEugen Rochko 5059989cc7 Use CircleCI workflows for ruby dependencies (#8228)
* Add “bundle clean” suggestion from CircleCI doc

Cf. https://circleci.com/docs/2.0/caching/#bundler-ruby

* Use workspaces instead of caches for ruby gems

Cache are not guaranteed to be available, while the test jobs *require* their
depencies to run. Workspaces are thus more suitable.

One downside is that the order of workspace layer additions need to be
deterministic, which is why install-ruby{2.3,2.4} now depend on
install-ruby2.5.
2018-08-18 04:05:42 +02:00
ThibGandEugen Rochko 59f7f4c923 Implement Undo { Accept { Follow } } (fixes #8234) (#8245)
* Add Follow#revoke_request!

* Implement Undo { Accept { Follow } } (fixes #8234)
2018-08-17 16:24:56 +02:00
ThibGandEugen Rochko 1ee675d68b Use correct activity id in Accept when receiving duplicate Follow (fixes #8218) (#8244) 2018-08-17 14:08:17 +02:00
ThibGandEugen Rochko 4601a58ac2 Defer scrollIntoView after DOM is drawn (fixes #8239) (#8242) 2018-08-17 14:07:38 +02:00