Commit graph

2124 commits

Author SHA1 Message Date
Matt Jankowski 9322396e58
Use normalizes to prepare Account#username value (#28646) 2024-01-08 13:48:31 +00:00
Matt Jankowski cd58e37b25
Remove unused DomainBlock#affected_accounts_count method (#28642) 2024-01-08 13:38:52 +00:00
Matt Jankowski 4ccba94489
Remove unused *_silenced_accounts scopes on Status (#28644) 2024-01-08 13:35:53 +00:00
Matt Jankowski c52a593a30
Remove unused scope User.emailable (#28647) 2024-01-08 13:33:45 +00:00
Matt Jankowski e827c4692c
Use Arel matches method in CustomEmoji search (#28615) 2024-01-08 13:26:12 +00:00
Matt Jankowski 1bc5a52139
Extract SQL heredoc method for Announcement scopes (#28613) 2024-01-08 11:22:16 +00:00
Matt Jankowski aa6d07dbd9
Use normalizes to prepare CustomEmoji domain value (#28624) 2024-01-08 11:20:59 +00:00
Matt Jankowski 202951e6d9
Use Arel in_order_of method to generate CASE for DomainBlock.by_severity (#28617) 2024-01-08 11:15:36 +00:00
Matt Jankowski 57f49c8191
Use Arel nulls_first method in ordering CustomEmojiFilter scope (#28614) 2024-01-08 11:09:50 +00:00
Jean Boussier 5a6d533c53
Enable Rails 7.1 Marshalling format (#28609) 2024-01-05 21:57:47 +00:00
Matt Jankowski 12bed81187
Add validation specs to CustomFilter model (#28600) 2024-01-05 15:13:59 +00:00
Claire dfdadb92e8
Add ability to require approval when users sign up using specific email domains (#28468) 2024-01-04 09:07:05 +00:00
Michael Stanclift 195b89d336
Fix .opus file uploads being misidentified by Paperclip (#28580) 2024-01-03 19:02:53 +00:00
Claire 35b6583371 Merge commit '6374358357ee81b5f137f471f028a56974109155' into glitch-soc/merge-upstream 2023-12-29 17:40:57 +01:00
Claire fcfdeadc04
Fix random NoMethodError errors on cached CustomFilter objects (#28521) 2023-12-29 16:23:07 +00:00
Matt Jankowski ba5f659bb3
Use shorter attribute query methods in Announcement (#28474) 2023-12-29 10:55:50 +00:00
Matt Jankowski 128c5b7db3
Fix Performance/StringIdentifierArgument cop (#28508) 2023-12-29 10:23:30 +00:00
Claire c5b0e6d5a0 Merge branch 'main' into glitch-soc/merge-upstream 2023-12-28 16:57:10 +01:00
Claire ea6c187fca Fix media attachment order of remote posts (#28469) 2023-12-22 18:45:36 +01:00
Claire 2bf84b93d4
Fix media attachment order of remote posts (#28469) 2023-12-22 15:10:39 +00:00
Claire 30ee7339d3 Merge commit '7d9b209fe84b00eff348ea9d54905cbfffa79788' into glitch-soc/merge-upstream
Conflicts:
- `app/models/form/admin_settings.rb`:
  Upstream changed code style change, including on a line modified by glitch-soc.
  Kept glitch-soc's line but with the code style change applied.
2023-12-21 19:31:12 +01:00
Claire f5b7307890 Merge commit 'f99e05710ea06cf10bbd3fb64ae8c00b095cb455' into glitch-soc/merge-upstream
Conflicts:
- `.rubocop_todo.yml`:
  Took upstream's version of the conflicting lines.
2023-12-21 19:24:10 +01:00
Claire a60b9acf3c Merge commit 'b2f915b31ae884e3893e93a99da4e2b8d7e9ef7b' into glitch-soc/merge-upstream 2023-12-21 19:04:20 +01:00
Claire 6e56f95285 Merge commit '4a7395d989e40c3bd4ef18173aa5ea850c8ddcdd' into glitch-soc/merge-upstream
Conflicts:
- `README.md`:
  Upstream modified its README, we have a completely different one.
  Kept our README file.
2023-12-21 18:17:17 +01:00
Claire 077e0c6812 Merge commit '0b4a3a04378ce43f2f314b9446b5053f6b374c6d' into glitch-soc/merge-upstream
Conflicts:
- `Gemfile.lock`:
  Conflict caused by the `json` gem thing once again.
  Updated as upstream did, but keeping the most recent `json` version.
- `spec/helpers/application_helper_spec.rb`:
  Upstream refactored a bunch of specs, including one place that differs
  because of glitch-soc's theming system.
  Refactored as upstream did, adapting it for glitch-soc's theming system.
2023-12-20 22:16:50 +01:00
Claire 75580360cd Merge commit '272592d16d40e804ec325ef3b5e6de9bbad5f2dd' into glitch-soc/merge-upstream
Conflicts:
- `.rubocop_todo.yml`:
  Upstream fixed a bunch lint issues, and changed the `Max` parameter of the
  `Metrics/AbcSize` cop.
  Glitch-soc has different code and slightly higher `AbcSize` complexity,
  modified the `.rubocop_todo.yml` file accordingly.
- `app/policies/status_policy.rb`:
  Upstream changed `account.suspended?` to `account.unavailable?` to prepare
  for delete flags. Glitch-soc has additional local-only conditions.
  Ported upstream's refactor while keeping glitch-soc's additional condition.
- `app/serializers/initial_state_serializer.rb`:
  Upstream refactored a bunch of stuff while glitch-soc has more settings.
  Refactored as upstream did while keeping glitch-soc's settings.
2023-12-20 22:05:31 +01:00
Claire b8209c3b96 Merge commit '85662a5a57531af5402a6777d0b1089e78c56815' into glitch-soc/merge-upstream
Conflicts:
- `config/initializers/content_security_policy.rb`:
  Upstream reworked the CSP, we kept our version for now.
- `spec/requests/content_security_policy_spec.rb`:
  Upstream reworked the CSP, we kept our version for now.
2023-12-20 20:10:45 +01:00
Claire d29b1cca2e
Fix friends_of_friends sometimes suggesting already-followed accounts (#28433) 2023-12-20 14:35:59 +00:00
Claire b135b6ba8f Merge commit '8ebc94dd22a18c28c4c9763b909e92e6ba64e242' into glitch-soc/merge-upstream
Conflicts:
- `app/views/admin/custom_emojis/new.html.haml`:
  Conflict caused by glitch-soc having a different file size limit constant
  name.
  Updated like upstream did while keeping glitch-soc's constant name.
2023-12-19 21:24:01 +01:00
Claire 2e786e13cb Merge commit '973597c6f1e25b16c592e5573304319aeaa375e1' into glitch-soc/merge-upstream
Conflicts:
- `app/validators/status_pin_validator.rb`:
  Upstream refactored that file, while glitch-soc had configurable limits for
  pinned statuses.
  Updated the code with upstream's refactor, while keeping glitch-soc's
  configurability.
2023-12-19 20:51:37 +01:00
Claire 8afd313807 Merge commit '15b2d7eec59c745b418debf63907d8bd08c4a730' into glitch-soc/merge-upstream
Conflicts:
- `package.json`:
  Upstream split some dependencies, including `express`, to
  `streaming/package.json`.
  However, glitch-soc had extra dependencies textually close to `express`.
  Kept the extra dependencies and moved `express` to streaming.
- `yarn.lock`:
  Upstream split some dependencies, including `express`, to
  `streaming/package.json`.
  However, glitch-soc had extra dependencies textually close to `express`.
  Kept the extra dependencies and moved `express` to streaming.
2023-12-19 20:06:32 +01:00
Eugen Rochko b5ac61b2c5
Change algorithm of follow recommendations (#28314)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-12-19 10:59:43 +00:00
Claire a111fd7a0b Merge commit 'b2c5b20ef27edd948eca8d6bd2014b7a5efaec11' into glitch-soc/merge-upstream 2023-12-18 20:47:27 +01:00
Claire d6ad9d351e Merge commit 'a36b59be8ad7656b7ceab9751c9ec5b3563e3a30' into glitch-soc/merge-upstream 2023-12-18 19:10:43 +01:00
Claire 7d9b209fe8
Fix call to inefficient delete_matched cache method in domain blocks (#28374) 2023-12-18 16:14:43 +00:00
Matt Jankowski 1820bad646
Fix Performance/StringIdentifierArgument cop (#28399) 2023-12-18 10:26:09 +00:00
Matt Jankowski 0e5b8fc46b
Fix Style/RedundantReturn cop (#28391) 2023-12-18 09:50:51 +00:00
Claire 4113fbf6e8 Merge commit 'f476d9dab2f5cca6ae44b95961df6b6557d66dab' into glitch-soc/merge-upstream
Conflicts:
- `lib/sanitize_ext/sanitize_config.rb`:
  Upstream enforced new code style rules, where we had different code.
  Applied the new code style rules.
2023-12-17 23:04:16 +01:00
Claire 1474318691 Merge commit 'a916251d8a8fffcaeb6be80eacf50138a53650dc' into glitch-soc/main
Conflicts:
- `app/models/trends/statuses.rb`:
  Upstream fixed a bug in the trending post condition.
  Glitch-soc's condition is different because we potentially allow CWed content
  to trend.
  Ported upstream's fix while keeping glitch-soc's change.
- `config/initializers/content_security_policy.rb`:
  Kept our version for now, we will switch to upstream later down the road.
2023-12-17 15:32:29 +01:00
Matt Jankowski b1dec09d20
Fix Style/InverseMethods cop (#28377) 2023-12-15 15:52:00 +00:00
Claire dcc24db793
Fix N+1s because of association preloaders not actually getting called (#28339) 2023-12-13 07:47:32 +00:00
Claire 9f92b05bd2 Merge commit '2e6bf60f1549e5c1f1cfea2d614f978bea17b8a2' into glitch-soc/merge-upstream
Conflicts:
- `README.md`:
  Upstream has updated their README but we have a completely different one.
  Kept our version of `README.md`
2023-12-10 18:05:02 +01:00
Matt Jankowski 3918dc68c7
Use composite primary key for PreviewCardsStatus model (#28208) 2023-12-07 14:49:05 +00:00
Matt Jankowski 5631f139c1
Fix Lint/SymbolConversion cop (#28175) 2023-12-01 15:53:35 +00:00
Matt Jankowski d83d01eb1e
Fix Lint/RedundantSafeNavigation cop (#28172) 2023-12-01 15:52:56 +00:00
Matt Jankowski f70f39dd04
Add explicit dependent: nil to associations (#28169) 2023-12-01 15:52:47 +00:00
Matt Jankowski 440b80b2e7
Model concerns organization into module namespaces (#28149) 2023-12-01 11:00:41 +00:00
Claire 963354978a
Add Account#unavailable? and Account#permanently_unavailable? aliases (#28053) 2023-11-30 15:43:26 +00:00
Matt Jankowski bb0efe16e6
Remove default_scope from MediaAttachment class (#28043) 2023-11-30 13:30:35 +00:00
Matt Jankowski e48ecd2929
Remove default_scope from Admin::ActionLog (#28026) 2023-11-29 10:39:59 +00:00
Matt Jankowski 186895fc88
Refactor, lint fix, and bug fix on admin/roles/form partial (#27558) 2023-11-29 10:00:52 +00:00
Claire 3a24754229
Change GIF max matrix size error to explicitly mention GIF files (#27927) 2023-11-24 09:31:28 +00:00
Matt Jankowski 4be12791e6
Remove default_scope from StatusEdit class (#28042) 2023-11-23 09:26:11 +00:00
Eugen Rochko cdc57c74b7
Fix unsupported time zone or locale preventing sign-up (#28035)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-11-22 11:38:07 +00:00
Matt Jankowski d2aacea8da
Reduce .times usage in AccountSearch spec, use constant for default limit (#27946) 2023-11-20 09:08:22 +00:00
ppnplus 2b038b4f89
Added Thai diacritics and tone marks in HASHTAG_INVALID_CHARS_RE (#26576) 2023-11-14 15:33:59 +00:00
Matt Jankowski b7807f3d84
Use normalizes to prepare Webhook#events value (#27605) 2023-11-13 22:47:44 +00:00
Eugen Rochko 0d14fcebae
Change link previews to keep original URL from the status (#27312) 2023-11-13 09:58:28 +00:00
Matt Jankowski 45770c9306
Fix Performance/MapMethodChain cop (#27744) 2023-11-07 13:01:09 +00:00
Matt Jankowski bbad5b6456
Remove false positive cop detection (#27457) 2023-11-07 10:44:15 +00:00
Claire 6c52f8286b
Fix posts from force-sensitized accounts being able to trend (#27620) 2023-10-30 22:32:25 +00:00
Claire 93e4cdc31b
Fix hashtag matching pattern matching some URLs (#27584) 2023-10-27 14:04:51 +00:00
Matt Jankowski 12550a6a28
Use Rails.env.local? shorthand method to check env (#27519) 2023-10-26 21:20:41 +00:00
Claire 4ef66d6538 Merge commit '15182d1e5e595b21c47b48c5d258f30a0251e753' into glitch-soc/merge-upstream
Conflicts:
- `.rubocop_todo.yml`:
  glitch-soc had extra ignores.
  Removed them.
2023-10-24 20:31:20 +02:00
Claire 4b0fb764c3 Merge commit 'e93a75f1a11d6dfdcbd39dbdc22526c5508ad881' into glitch-soc/merge-upstream
Conflicts and ported changes:
- updated `@rails/ujs` imports
2023-10-24 19:59:19 +02:00
Claire 57c0de949b Merge commit '8b770ce8110e6cd609a6769c66210d95e291e3e5' into glitch-soc/merge-upstream
Conflicts:
- `config/initializers/content_security_policy.rb`:
  Upstream changed how asset host CSP directives are used, and glitch-soc has
  a pretty different CSP file.
  It may be worth reconsidering the differences between upstream and glitch-soc
  but for now, just port the change.
2023-10-24 19:17:20 +02:00
Claire 787d5ad386 Merge commit 'bcae7442757845191c0e82b61cd1d0cd3ca860d1' into glitch-soc/merge-upstream
Conflicts:
- `yarn.lock`:
  Caused by a glitch-soc-only dependency (`exif-js`).
  Kept it.
2023-10-24 19:05:18 +02:00
Claire b0c76eaadd Merge commit '0ad66175bf59a34b03d9ab2347181548d07089ea' into glitch-soc/merge-upstream
Conflicts:
- `app/javascript/mastodon/features/compose/components/compose_form.jsx`:
  Upstream changed one import, close to a glitch-soc-only import to handle
  different max character counts.
  Ported upstream's change.
2023-10-24 18:41:20 +02:00
Matt Jankowski 714e3ae5b5
Use Rails 7.1 normalizes feature (#27521) 2023-10-24 10:06:10 +00:00
Matt Jankowski e93a75f1a1
Rails 7.1 update (#25963) 2023-10-23 17:58:29 +00:00
Claire 8b770ce811
Add warnings to report action logs (#27425) 2023-10-23 14:30:46 +02:00
Claire bcae744275
Fix some link anchors being recognized as hashtags (#27271) 2023-10-23 14:19:38 +02:00
Matt Jankowski b0213472df
Validate allowed schemes on preview card URLs (#27485) 2023-10-23 09:50:02 +02:00
Claire 74fd46d3ab Merge commit '9f218c9924b883207a3463a29314c92032cf06df' into glitch-soc/merge-upstream 2023-10-19 19:14:04 +02:00
Matt Jankowski 63a2a4b074
Fix Performance/DeletePrefix cop (#27448) 2023-10-18 10:32:09 +02:00
Claire c10a667ac2 Merge commit '935d54124e80e9fe5365c724e5c8827a2b3ed5b3' into glitch-soc/merge-upstream 2023-10-17 21:42:49 +02:00
Matt Jankowski 08a376cbcb
Fix Style/CombinableLoops cop (#27429) 2023-10-16 16:36:28 +02:00
Claire 53f5b27bd1 Merge commit '640421f661ee4d7e76a2aab607e7b15687940b6f' into glitch-soc/merge-upstream 2023-10-08 17:30:48 +02:00
Claire ac2370778a Merge commit 'c676bc91e9c3aa81eb7cfbce3c5c5e80b84d3d02' into glitch-soc/merge-upstream
Conflicts:
- `config/environments/production.rb`:
  Upstream enforced a code style change and glitch-soc had a few different lines.
  Applied upstream's code style to glitch-soc's changes.
2023-10-08 17:21:12 +02:00
Claire d7fcd70023 Merge commit '2016c5d912f400ae98ee03ce269112de2f9ec62d' into glitch-soc/merge-upstream
Conflicts:
- `config/initializers/cors.rb`:
  Upstream refactored this file, and glitch-soc had local changes.
  I could not find the rationale for the glitch-soc changes, so I
  used upstream's version.
2023-10-08 16:41:56 +02:00
Claire 19ebf7797e Merge commit 'e6b903b21e0682c1156ffec583ac2836fda7d657' into glitch-soc/merge-upstream 2023-10-08 16:30:00 +02:00
Claire 340c390849
Fix crash when filtering for “dormant” relationships (#27306) 2023-10-06 12:58:16 +02:00
Matt Jankowski c676bc91e9
Dont match mention in url query string (#25656)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-10-03 17:01:45 +02:00
Matt Jankowski 2016c5d912
Fix deprecation warning about rewhere: true being default behavior (Rails 7.1 prep) (#27190) 2023-09-28 16:52:23 +02:00
Matt Jankowski 3060bfa4bd
Extract filename and csv helper methods from Form::Import (#26129) 2023-09-28 16:22:05 +02:00
Claire 686406cc2d
Fix filtering audit log for entries about disabling 2FA (#27186) 2023-09-28 13:41:24 +02:00
Claire abdb58840a Merge commit '57f592fed50747f3c97718a2761e17bafe6c8698' into glitch-soc/merge-upstream 2023-09-26 13:13:27 +02:00
Essem bd810391d6
Properly remove tIME chunk from PNG uploads (#27111) 2023-09-25 19:21:07 +02:00
Claire 1bd7455d81
Fix inefficient queries in “Follows and followers” as well as several admin pages (#27116) 2023-09-25 15:06:43 +02:00
Claire 39da3d86f8
Fix ActiveRecord using two connection pools when no replica is defined (#27061) 2023-09-22 16:01:59 +02:00
Claire dfc05ec8df Merge commit '6273416292090b2f6bfda33f070cea325a1759df' into glitch-soc/merge-upstream
Conflicts:
- `.github/workflows/build-nightly.yml`:
  Upstream modified this file close to a line modified by glitch-soc to
  disable the ARMv64 builder (as glitch-soc doesn't have one).
  Ported upstream's changes.
- `.github/workflows/build-releases.yml`:
  Upstream modified this file close to lines changed by glitch-soc to
  change the Docker image repositories used (only ghcr, and based on the
  organization's name).
  Ported upstream's changes.
2023-09-15 21:43:49 +02:00
Claire 5ed72f668f Merge commit 'b90383d07388fe8513e59a6deb1a2391146c6561' into glitch-soc/merge-upstream 2023-09-15 21:39:21 +02:00
Claire 08b495d95c Merge commit 'b1d89071384ef028c97a3d28cf8cf6bc0ca6c4ce' into glitch-soc/merge-upstream 2023-09-15 21:06:45 +02:00
Claire 5d8c65f2a7 Merge commit '398635c0c4987ec44d937e98431ff5dee331ea94' into glitch-soc/merge-upstream 2023-09-15 20:57:40 +02:00
Claire e4f5114aaf
Fix obsolete cache key in status cache invalidation logic (#26934) 2023-09-15 19:52:28 +02:00
Eugen Rochko fc6825055b
Change score half-life for trending posts from 2 hours to 1 hour (#26915) 2023-09-14 09:20:14 +02:00
Robert R George 20666482ef
Added admin api for managing tags (#26872) 2023-09-13 11:22:53 +02:00
Claire 81caafbe84
Fix performances of profile directory (#26842) 2023-09-07 18:55:25 +02:00
Claire 355e3fb529
Simplify Account.by_recent_status and Account.by_recent_sign_in scopes (#26840) 2023-09-07 15:38:11 +02:00
Colette Kerr 8a9d7aeb1e
Change DCT method used for JPEG encoding to float (#26675) 2023-09-07 05:26:25 +02:00