about summary refs log tree commit diff
path: root/app/models/user.rb
AgeCommit message (Collapse)Author
2023-04-09Fix most rubocop issues (#2165)Claire
* Run rubocop --autocorrect on app/, config/ and lib/, also manually fix some remaining style issues * Run rubocop --autocorrect-all on db/ * Run rubocop --autocorrect-all on `spec/` and fix remaining issues
2023-03-31Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `README.md`: Upstream added a link to the roadmap, but we have a completely different README. Kept ours. - `app/models/media_attachment.rb`: Upstream upped media attachment limits. Updated the default according to upstream's. - `db/migrate/20180831171112_create_bookmarks.rb`: Upstream changed the migration compatibility level. Did so too. - `config/initializers/content_security_policy.rb`: Upstream refactored this file but we have a different version. Kept our version. - `app/controllers/settings/preferences_controller.rb`: Upstream completely refactored user settings storage, and glitch-soc has a different set of settings. The file does not directly references individual settings anymore. Applied upstream changes. - `app/lib/user_settings_decorator.rb`: Upstream completely refactored user settings storage, and glitch-soc has a different set of settings. The file got removed entirely. Removed it as well. - `app/models/user.rb`: Upstream completely refactored user settings storage, and glitch-soc has a different set of settings. References to individual settings have been removed from the file. Removed them as well. - `app/views/settings/preferences/appearance/show.html.haml`: Upstream completely refactored user settings storage, and glitch-soc has a different set of settings. Applied upstream's changes and ported ours back. - `app/views/settings/preferences/notifications/show.html.haml`: Upstream completely refactored user settings storage, and glitch-soc has a different set of settings. Applied upstream's changes and ported ours back. - `app/views/settings/preferences/other/show.html.haml`: Upstream completely refactored user settings storage, and glitch-soc has a different set of settings. Applied upstream's changes and ported ours back. - `config/settings.yml`: Upstream completely refactored user settings storage, and glitch-soc has a different set of settings. In particular, upstream removed user-specific and unused settings. Did the same in glitch-soc. - `spec/controllers/application_controller_spec.rb`: Conflicts due to glitch-soc's theming system. Mostly kept our version, as upstream messed up the tests.
2023-03-30Change user settings to be stored in a more optimal way (#23630)Eugen Rochko
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-03-15Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `.github/workflows/build-image.yml`: Upstream switched to pushing to both DockerHub and GitHub Container Repository, while glitch-soc was already pushing to the latter only. Updated our configuration to be slightly more consistent with upstream's naming and styling, but kept our behavior. - `Gemfile.lock`: Updated dependencies textually too close to glitch-soc only hcaptcha dependency. Updated dependencies as upstream did. - `README.md`: Upstream updated its README, but we have a completely different one. Kept our README, though it probably should be reworked at some point. - `app/views/auth/sessions/two_factor.html.haml`: Minor style fix upstream that's on a line glitch-soc removed because of its different theming system. Kept our file as is. - `spec/controllers/health_controller_spec.rb`: This file apparently did not exist upstream, upstream created it with different contents but it is functionally the same. Switched to upstream's version of the file. - `spec/presenters/instance_presenter_spec.rb`: Upstream changed the specs around `GITHUB_REPOSITORY`, while glitch-soc had its own code because it's a fork and does not have the same default source URL. Took upstream's change, but with glitch-soc's repo as the default case. - `yarn.lock`: Upstream dependencies textually too close to a glitch-soc only one. Updated dependencies as upstream did.
2023-03-06Fix unconfirmed accounts being registered as active users (#23803)Claire
2023-02-25Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `.prettierignore`: Upstream added a line at the end of the file, while glitch-soc had its own extra lines. Took upstream's change. - `CONTRIBUTING.md`: We have our custom CONTRIBUTING.md quoting upstream. Upstream made changes. Ported upstream changes. - `app/controllers/application_controller.rb`: Upstream made code style changes in a method that is entirely replaced in glitch-soc. Ignored the change. - `app/models/account.rb`: Code style changes textually close to glitch-soc-specific changes. Ported upstream changes. - `lib/sanitize_ext/sanitize_config.rb`: Upstream code style changes. Ignored them.
2023-02-20Autofix Rubocop remaining Layout rules (#23679)Nick Schonning
2023-02-09Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `README.md`: Minor upstream change, our README is completely different. Kept ours. - `lib/tasks/assets.rake`: glitch-soc has extra code to deal with its theming system, upstream changed a line that exists in glitch-soc. Applied upstream changes.
2023-02-08Apply Rubocop Style/NegatedIfElseCondition (#23451)Nick Schonning
2023-01-24Merge branch 'main' into glitch-soc/merge-upstreamClaire
2023-01-24Fix account activation being triggered before email confirmation (#23245)Claire
* Add tests * Fix account activation being triggered before email confirmation Fixes #23098
2023-01-05Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `README.md`: Upstream updated its README, while we have a completely different one. Kept our README. - `app/controllers/concerns/web_app_controller_concern.rb`: Conflict because of glitch-soc's theming system. Additionally, glitch-soc has different behavior regarding moved accounts. Ported some of the changes, but kept our overall behavior. - `app/javascript/packs/admin.js`: Code changes actually applied to `app/javascript/core/admin.js`
2023-01-05Add webhook `account.approved` (#22938)Alexander Ivanov
* Webhook `account.approved` when preparing new user * Update Webhook.EVENTS
2022-12-15Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `README.md`: Discarded upstream changes: we have our own README - `app/controllers/follower_accounts_controller.rb`: Port upstream's minor refactoring
2022-12-15Revoke all authorized applications on password reset (#21325)Francis Murillo
* Clear sessions on password change * Rename User::clear_sessions to revoke_access for a clearer meaning * Add reset paassword controller test * Use User.find instead of User.find_for_authentication for reset password test * Use redirect and render for better test meaning in reset password Co-authored-by: Effy Elden <effy@effy.space>
2022-12-09Merge branch 'main' into glitch-soc/mainClaire
2022-12-07Fix failure when “Require a reason to join” is set with open ↵Claire
registrations (#22127)
2022-11-17Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `.github/workflows/build-image.yml`: Upstream changed how docker images were built, including how they were cached. I don't know much about it, so applied upstream's changes. - `app/controllers/admin/domain_blocks_controller.rb`: The feature, that was in glitch-soc, got backported upstream. It also had a few fixes upstream, so those have been ported! - `app/javascript/packs/admin.js`: Glitch-soc changes have been backported upstream. As a result, some code from `app/javascript/core/admin.js` got added upstream. Kept our version since our shared Javascript already has that feature. - `app/models/user.rb`: Upstream added something to distinguish unusable and unusable-because-moved accounts, while glitch-soc considers moved accounts usable. Took upstream's code for `functional_or_moved?` and made `functional?` call it. - `app/views/statuses/_simple_status.html.haml`: Upstream cleaned up code style a bit, on a line that we had custom changes for. Applied upstream's change while keeping our change. - `config/initializers/content_security_policy.rb`: Upstream adopted one CSP directive we already had. The conflict is because of our files being structurally different, but the change itself was already part of glitch-soc. Kept our version.
2022-11-17Change automatic post deletion configuration to be accessible to redirected ↵Claire
users (#20774) Fixes #20550
2022-10-28Merge branch 'main' into glitch-soc/merge-upstreamClaire
2022-10-20Change public accounts pages to mount the web UI (#19319)Eugen Rochko
* Change public accounts pages to mount the web UI * Fix handling of remote usernames in routes - When logged in, serve web app - When logged out, redirect to permalink - Fix `app-body` class not being set sometimes due to name conflict * Fix missing `multiColumn` prop * Fix failing test * Use `discoverable` attribute to control indexing directives * Fix `<ColumnLoading />` not using `multiColumn` * Add `noindex` to accounts in REST API * Change noindex directive to not be rendered by default before a route is mounted * Add loading indicator for detailed status in web UI * Fix missing indicator appearing while account is loading in web UI
2022-10-02Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `app/controllers/home_controller.rb`: Upstream made it so `/web` is available to non-logged-in users and `/` redirects to `/web` instead of `/about`. Kept our version since glitch-soc's WebUI doesn't have what's needed yet and I think /about is still a much better landing page anyway. - `app/models/form/admin_settings.rb`: Upstream added new settings, and glitch-soc had an extra setting. Not really a conflict. Added upstream's new settings. - `app/serializers/initial_state_serializer.rb`: Upstream added a new `server` initial state object. Not really a conflict. Merged upstream's changes. - `app/views/admin/settings/edit.html.haml`: Upstream added new settings. Not really a conflict. Merged upstream's changes. - `app/workers/scheduler/feed_cleanup_scheduler.rb`: Upstream refactored that part and removed the file. Ported our relevant changes into `app/lib/vacuum/feeds_vacuum.rb` - `config/settings.yml`: Upstream added new settings. Not a real conflict. Added upstream's new settings.
2022-09-28Fix language dropdown sometimes not appearing in web UI (#19246)Eugen Rochko
When user has no locale preference saved (such as never changing it from the default), the preferred posting language is nil, and the dropdown is not visible
2022-08-28Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `app/controllers/settings/preferences_controller.rb`: Upstream dropping `digest` from notifications emails while we have more notification emails settings. Removed `digest` from our list while keeping our extra settings. - `app/javascript/packs/admin.js`: Conflicts caused by glitch-soc's theming system. Applied the changes to `app/javascript/core/admin.js`. - `app/views/settings/preferences/other/show.html.haml`: Upstream removed a setting close to a glitch-soc-only setting. Applied upstream's change.
2022-08-25Remove digest e-mails (#17985)Eugen Rochko
* Remove digest e-mails * Remove digest-related code
2022-08-25Add audit log entries for user roles (#19040)Eugen Rochko
* Refactor audit log schema * Add audit log entries for user roles
2022-08-25Merge branch 'main' into glitch-soc/merge-upstreamClaire
2022-08-25Add option for EMAIL_DOMAIN_DENYLIST/EMAIL_DOMAIN_ALLOWLIST to apply after ↵Claire
confirmation (#18642) Fixes #18620
2022-07-05Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `app/controllers/admin/base_controller.rb`: Minor conflict caused by glitch-soc's theming system. - `app/javascript/mastodon/initial_state.js`: Minor conflict caused by glitch-soc making use of max_toot_chars. - `app/models/form/admin_settings.rb`: Minor conflict caused by glitch-soc's theming system. - `app/models/trends.rb`: Minor conflict caused by glitch-soc having more granular notification settings for trends. - `app/views/admin/accounts/index.html.haml`: Minor conflict caused by glitch-soc's theming system. - `app/views/admin/instances/show.html.haml`: Minor conflict caused by glitch-soc's theming system. - `app/views/layouts/application.html.haml`: Minor conflict caused by glitch-soc's theming system. - `app/views/settings/preferences/notifications/show.html.haml`: Minor conflict caused by glitch-soc having more granular notification settings for trends. - `config/navigation.rb`: Minor conflict caused by glitch-soc having additional navigation items for the theming system while upstream slightly changed every line.
2022-07-05Add customizable user roles (#18641)Eugen Rochko
* Add customizable user roles * Various fixes and improvements * Add migration for old settings and fix tootctl role management
2022-06-10Merge branch 'main' into glitch-soc/merge-upstreamClaire
2022-06-09Add administrative webhooks (#18510)Eugen Rochko
* Add administrative webhooks * Fix error when webhook is deleted before delivery worker runs
2022-06-02Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `app/javascript/styles/fonts/montserrat.scss`: Code style changes upstream, path changes in glitch-soc. Applied upstream's code style changes. - `app/javascript/styles/fonts/roboto-mono.scss`: Code style changes upstream, path changes in glitch-soc. Applied upstream's code style changes. - `app/javascript/styles/fonts/roboto.scss`: Code style changes upstream, path changes in glitch-soc. Applied upstream's code style changes. - `app/models/account.rb`: Textual conflict only caused by glitch-soc using a different value for character limits in a nearby line. Applied upstream's changes. - `app/views/statuses/_simple_status.html.haml`: Attribute added to a tag modified by glitch-soc. Added upstream's attributes. - `yarn.lock`: Upstream added/updated dependencies close to glitch-soc-only ones. Updated/added upstream dependencies.
2022-05-27Remove unused `filtered_languages` column (#18533)Claire
* Remove unused `filtered_languages` column Fixes #18522 * Fix tests
2022-05-16Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `app/javascript/mastodon/features/compose/components/compose_form.js`: Conflict caused because of minor code style change upstream, while glitch-soc has different code for handling variable maximum chars. Ported the change. - `app/serializers/initial_state_serializer.rb`: Conflict because glitch-soc had two extra attributes where upstream added one. Added upstream's attribute.
2022-05-16Fix preferred posting language returning unusable value in REST API (#18428)Eugen Rochko
2022-04-28Merge branch 'main' into glitch-soc/merge-upstreamClaire
2022-04-28Fix single Redis connection being used across all threads (#18135)Eugen Rochko
* Fix single Redis connection being used across all Sidekiq threads * Fix tests
2022-04-08Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `Gemfile.lock`: Not a real conflict, just an upstream dependency udpated textually too close to a glitch-soc-only dependency. Updated dependencies like upstream. - `app/controllers/settings/preferences_controller.rb`: Upstream added settings where we had extra glitch-soc-specific settings. Added upstream's new settings. - `app/models/user.rb`: Upstream added settings where we had extra glitch-soc-specific settings. Added upstream's new settings. - `config/i18n-tasks.yml`: Not a real conflict, just a new upstream line too textually close to a glitch-soc-only line. Ported upstream's change.
2022-04-08Change e-mail notifications to only be sent when recipient is offline (#17984)Eugen Rochko
* Change e-mail notifications to only be sent when recipient is offline Change the default for follow and mention notifications back on * Add preference to always send e-mail notifications * Change wording
2022-04-06Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `app/controllers/concerns/sign_in_token_authentication_concern.rb`: Upstream removed this file, while glitch-soc had changes to deal with its theming system. Removed the file like upstream did.
2022-04-06Remove sign-in token authentication, instead send e-mail about new sign-in ↵Eugen Rochko
(#17970)
2022-03-30Merge branch 'main' into glitch-soc/merge-upstreamClaire
2022-03-30Fix being able to bypass e-mail restrictions (#17909)Eugen Rochko
2022-03-26Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `app/lib/formatter.rb`: Upstream completely refactored the formatting code and removed that file, while glitch-soc had code for Markdown and HTML toots. Took upstream code, glitch-soc changes will be re-implemented on top of the refactored classes in a later commit. - `app/models/status.rb`: Upstream refactored status edit handling and moved code to `app/models/concerns/status_snapshot_concern.rb`. Applied glitch-soc's changes to that file. - `app/serializers/activitypub/note_serializer.rb`: Not really a conflict, just a line added too close to one modified by glitch-soc. Applied upstream changes while keeping the glitch-soc-modified one. - `app/services/update_status_service.rb`: Not really a conflict, upstream modified a line adjacent to one added by glitch-soc. Applied upstream changes while keeping the glitch-soc line. - `app/views/statuses/_simple_status.html.haml`: Upstream refactored formatting, glitch-soc changed the markup slightly. Applied upstream changes. - `spec/lib/formatter_spec.rb`: Upstream completely refactored the formatting code and removed that file, while glitch-soc had code for Markdown and HTML toots. Took upstream code, glitch-soc changes will be re-implemented on top of the refactored classes in a later commit.
2022-03-26Change how unconfirmed accounts are displayed in admin UI (#17874)Eugen Rochko
Fix #17815
2022-03-08Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `app/controllers/settings/preferences_controller.rb`: Conflicts due to us having more user settings and upstream dropping `hide_network` (to replace it with an account attribute, properly migrated). Dropped `hide_network` like upstream. - `app/lib/user_settings_decorator.rb`: Conflicts due to us having more user settings and upstream dropping `hide_network` (to replace it with an account attribute, properly migrated). Dropped `hide_network` like upstream. - `app/models/status.rb`: Conflict because of slight change in how glitch-soc handles the scope to filter out local-only posts for anonymous viewers. Took upstream's changes and re-applied glitch-soc's change. - `app/models/user.rb`: Conflicts due to us having more user settings and upstream dropping `hide_network` (to replace it with an account attribute, properly migrated). Dropped `hide_network` like upstream. - `app/views/directories/index.html.haml`: Conflict because upstream redesigned that page while glitch-soc had a minor change to support hiding the number of followers. Ported glitch-soc's change on top of upstream's redesign. Additional changes: - `app/models/account_statuses_filter.rb`: See change to `app/models/status.rb`.
2022-03-07Add `/api/v1/accounts/familiar_followers` to REST API (#17700)Eugen Rochko
* Add `/api/v1/accounts/familiar_followers` to REST API * Change hide network preference to be stored consistently for local and remote accounts * Add dummy classes to migration * Apply suggestions from code review Co-authored-by: Claire <claire.github-309c@sitedethib.com> Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2022-02-26Disable notifications for trending links and trending statuses by defaultClaire
2022-02-26Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `app/models/account.rb`: Not a real conflict, just upstream getting rid of unused constants too close to glitch-soc-specific contents. Removed unused constants like upstream did. - `app/models/trends.rb`: Conflict because glitch-soc disabled email notifications for trending links. Upstream has refactored this quite a bit and added trending posts. Took upstream code, but disabling the extra trending stuff will come in another commit. - `app/views/admin/trends/links/index.html.haml`: Conflict due to glitch-soc's theming system. Ported upstream changes accordingly.