about summary refs log tree commit diff
path: root/app/controllers/api/v1/notifications_controller.rb
AgeCommit message (Collapse)Author
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-21Autofix Rubocop Rails/FindById (#23762)Nick Schonning
2023-02-19Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `.github/dependabot.yml`: Upstream made changes while we have dropped this file. Keep the file deleted. - `.prettierignore`: Upstream made changes at the end of the file, where we had our extra lines. Just moved our extra lines back at the end. - `app/serializers/initial_state_serializer.rb`: Upstream code style changes. Applied them. - `app/services/backup_service.rb`: Upstream code style changes. Applied them.
2023-02-18Autofix Rubocop Style/IfUnlessModifier (#23697)Nick Schonning
2023-02-03Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `.github/workflows/build-image.yml`: Upstream updated `docker/build-push-action`, and we a different config for `docker/metadata-action` so the lines directly above were different, but it's not a real conflict. Upgraded `docker/build-push-action` as upstream did. - `app/javascript/mastodon/features/compose/components/compose_form.js`: Upstream changed the codestyle near a line we had modified to accommodate configurable character count. Kept our change.
2023-02-01Change notifications per page from 15 to 40 in REST API (#23348)Eugen Rochko
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-15Fix N+1 queries from in NotificationsController (#21202)nametoolong
Co-authored-by: Nonexistent <nx@example.org>
2022-05-27Fix incorrect permission check for notifications destroy/dismiss endpoints ↵Claire
(#1787)
2022-03-15Merge branch 'main' into glitch-soc/merge-upstreamClaire
Conflicts: - `README.md`: Upstream changed their README, we have a completely different one. Kept our README.
2022-03-15Add `types` param to `GET /api/v1/notifications` in REST API (#17767)Eugen Rochko
* Add `types` param to `GET /api/v1/notifications` in REST API * Improve tests
2021-02-03Merge branch 'main' into glitch-soc/merge-upstreamClaire
2021-01-31Improved performance of notification preloading (#15640)abcang
* Improved performance of notification preloading * Remove Cacheable from Notification * Fix test
2020-09-28Merge branch 'master' into glitch-soc/merge-upstreamThibaut Girka
Conflicts: - `Gemfile.lock`: Not a real conflict, upstream updated dependencies that were too close to glitch-soc-only ones in the file. - `app/controllers/oauth/authorized_applications_controller.rb`: Upstream changed the logic surrounding suspended accounts. Minor conflict due to glitch-soc's theming system. Ported upstream changes. - `app/controllers/settings/base_controller.rb`: Upstream refactored and changed the logic surrounding suspended accounts. Minor conflict due to glitch-soc's theming system. Ported upstream changes. - `app/controllers/settings/sessions_controller.rb`: Upstream refactored and changed the logic surrounding suspended accounts. Minor conflict due to glitch-soc's theming system. Ported upstream changes. - `app/models/user.rb`: Upstream refactored and changed the logic surrounding suspended accounts. Minor conflict due to glitch-soc not preventing moved accounts from logging in. Ported upstream changes while keeping the ability for moved accounts to log in. - `app/policies/status_policy.rb`: Upstream refactored and changed the logic surrounding suspended accounts. Minor conflict due to glitch-soc's local-only toots. Ported upstream changes. - `app/serializers/rest/account_serializer.rb`: Upstream refactored and changed the logic surrounding suspended accounts. Minor conflict due to glitch-soc's ability to hide followers count. Ported upstream changes. - `app/services/process_mentions_service.rb`: Upstream refactored and changed the logic surrounding suspended accounts. Minor conflict due to glitch-soc's local-only toots. Ported upstream changes. - `package.json`: Not a real conflict, upstream updated dependencies that were too close to glitch-soc-only ones in the file.
2020-09-11Change REST API to return empty data for suspended accounts (#14765)Eugen Rochko
2020-08-30Merge branch 'master' into glitch-soc/merge-upstreamThibaut Girka
Conflicts: - `app/controllers/accounts_controller.rb`: Upstream change too close to a glitch-soc change related to instance-local toots. Merged upstream changes. - `app/services/fan_out_on_write_service.rb`: Minor conflict due to glitch-soc's handling of Direct Messages, merged upstream changes. - `yarn.lock`: Not really a conflict, caused by glitch-soc-only dependencies being textually too close to updated upstream dependencies. Merged upstream changes.
2020-08-28Introduce ApplicationController#cache_collection_paginated_by_id (#14677)Akihiko Odaki
* Replace incorrect use of distinct with group Some uses of ActiveRecord::QueryMethods#distinct pass field names but they are incorrect for the current version of Rails. ActiveRecord::QueryMethods#group provides the expected behavior and benefits performance. See commit 6da24aad4cafdef8d8a2c92bac2002a5fc2fe9c8. * Introduce ApplicationController#cache_collection_paginated_by_id ApplicationController#cache_collection_paginated_by_id fuses ApplicationController#cache_collection and Paginable.paginate_by_id. An advantage of this method is that it prevents from modifying scope which Paginable.paginate_by_id may provide. ApplicationController#cache_collection always return an array and there is no possibility of the scope modification. It is also clear for a programmer, considering the implication of "cache". This method can also emit more efficient queries by using Cacheable.cache_ids before calling Paginable.paginate_by_id.
2020-03-08Merge branch 'master' into glitch-soc/merge-upstreamThibaut Girka
Conflicts: - `app/controllers/api/v1/statuses_controller.rb`: Conflict due to upstream adding a new parameter (with_rate_limit), too close to glitch-soc's own additional parameter (content_type). Added upstream's parameter. - `app/services/post_status_service.rb`: Conflict due to upstream adding a new parameter (rate_limit), too close to glitch-soc's own additional parameter (content_type). Added upstream's parameter. - `app/views/settings/preferences/appearance/show.html.haml`: Conflict due to us not exposing theme settings here (as we have a different flavour/skin menu). Took upstream change, while still not exposing theme settings. - `config/webpack/shared.js`: Coding style fixes for a part we have rewritten. Discarded upstream changes.
2020-03-06Remove useless `respond_to` calls (#13208)Eugen Rochko
2019-05-23Merge branch 'master' into glitch-soc/merge-upstreamThibaut Girka
Conflicts: - app/models/account.rb - app/views/settings/profiles/show.html.haml - spec/controllers/api/v1/accounts/credentials_controller_spec.rb Conflicts were due to an increase in account bio length upstream, which is already covered in glitch-soc through `MAX_BIO_CHARS`.
2019-05-21Add `account_id` param to `GET /api/v1/notifications` (#10796)Paul Woolcock
* Add `from_account` to notifications API this adds the ability to filter notifications by the account they originated from * passing a non-existent user should cause none to be returned * Fix codeclimate warnings * fix more codeclimate warnings * make requested changes: * use account id instead of user@domain * name the param `account_id` instead of `from_account` * Don't use `return` in a lambda
2018-10-01Merge branch 'master' into glitch-soc/merge-upstreamThibaut Girka
Conflicts: app/lib/user_settings_decorator.rb app/models/user.rb app/serializers/initial_state_serializer.rb app/views/stream_entries/_simple_status.html.haml config/locales/simple_form.en.yml config/locales/simple_form.ja.yml config/locales/simple_form.pl.yml config/routes.rb
2018-09-28Support min_id-based pagination in REST API (#8736)Eugen Rochko
* Allow min_id pagination in Feed#get * Add min_id pagination to home and list timeline APIs * Add min_id pagination to account statuses, public and tag APIs * Remove unused stub in reports API * Use min_id pagination in notifications, favourites, and fix order * Fix HomeFeed#from_database not using paginate_by_id
2018-07-09Merge branch 'master' into glitch-soc/tentative-mergeThibaut Girka
Conflicts: README.md app/controllers/statuses_controller.rb app/lib/feed_manager.rb config/navigation.rb spec/lib/feed_manager_spec.rb Conflicts were resolved by taking both versions for each change. This means the two filter systems (glitch-soc's keyword mutes and tootsuite's custom filters) are in place, which will be changed in a follow-up commit.
2018-07-05Add more granular OAuth scopes (#7929)Eugen Rochko
* Add more granular OAuth scopes * Add human-readable descriptions of the new scopes * Ensure new scopes look good on the app UI * Add tests * Group scopes in screen and color-code dangerous ones * Fix wrong extra scope
2018-04-01Merge remote-tracking branch 'origin/master' into gs-masterDavid Yip
Conflicts: app/javascript/mastodon/locales/en.json app/javascript/mastodon/locales/ja.json app/javascript/mastodon/locales/pl.json app/views/accounts/_header.html.haml
2018-04-02Fix unpermitted parameters warning when generating pagination URLs (#6995)Eugen Rochko
2017-07-21New notification cleaning mode (#89)Ondřej Hruška
This PR adds a new notification cleaning mode, super perfectly tuned for accessibility, and removes the previous notification cleaning functionality as it's now redundant. * w.i.p. notif clearing mode * Better CSS for selected notification and shorter text if Stretch is off * wip for rebase ~ * all working in notif clearing mode, except the actual removal * bulk delete route for piggo * cleaning + refactor. endpoint gives 422 for some reason * formatting * use the right route * fix broken destroy_multiple * load more notifs after succ cleaning * satisfy eslint * Removed CSS for the old notif delete button * Tabindex=0 is mandatory In order to make it possible to tab to this element you must have tab index = 0. Removing this violates WCAG and makes it impossible to use the interface without good eyesight and a mouse. So nobody with certain mobility impairments, vision impairments, or brain injuries would be able to use this feature if you don't have tabindex=0 * Corrected aria-label Previous label implied a different behavior from what actually happens * aria role localization & made the overlay behave like a checkbox * checkboxes css and better contrast * color tuning for the notif overlay * fanceh checkboxes etc and nice backgrounds * SHUT UP TRAVIS
2017-07-14Added buttons and menu items to dismiss individual notifications (#76)Ondřej Hruška
* Added DELETE verb for notifications * Added notification dismiss button to status dropdown * Added reveal-on-hover notif dismiss button, added FollowNotification component
2017-07-07Refactor JSON templates to be generated with ActiveModelSerializers instead ↵Eugen Rochko
of Rabl (#4090)
2017-06-08Improve RuboCop rules (compatibility to Code Climate) (#3636)Yamagishi Kazutoshi
https://github.com/codeclimate/codeclimate-rubocop/blob/08f8de84ebfb39caa96391e23816877278f6441c/Gemfile.lock#L38 Code Climate is using RuboCop v0.46.0. Change several rules to maintain compatibility.
2017-06-07Clean up for api/base controller (#3629)Matt Jankowski
* Move ApiController to Api/BaseController * API controllers inherit from Api::BaseController * Add coverage for various error cases in api/base controller
2017-05-31Refactor api/v1/notifications controller (#3470)Matt Jankowski
2017-04-22Added API for single notification dismissal (#2251)Ashley
* Added API backend for notification dismissal * Added render statement * Changed statement
2017-04-10API param to exclude notification types from response (#1341)Eugen
* Add exclude_types param to /api/v1/notifications * Exclude notification types in web UI through exclude_types in the API
2017-04-08Make public timelines API not require user context/app credentials (#1291)Eugen
* Make /api/v1/timelines/public and /api/v1/timelines/tag/:id public Fix #1156 - respect query params when generating pagination links in API * Apply pagination fix to more APIs
2017-03-30Add counter caches for a large performance increase on API requestsEugen Rochko
2017-02-25Add tuning documentation, add <content> tags back to most salmons,Eugen Rochko
make status pagination headers generation more lax about next page existing
2017-01-26Improve infinite scroll on notificationsEugen Rochko
2017-01-24API now respects ?limit param as long as it's within 2x default limitEugen Rochko
2017-01-23Add /api/v1/notifications/clear, non-existing link cards for statuses willEugen Rochko
now return empty hash instead of throwing a 404 error. When following, merge into timeline will filter statuses
2017-01-21Method to fetch a single notificationEugen Rochko
2016-12-26Follow requests send e-mail notifications, but are excluded from ↵Eugen Rochko
notifications API Better initial state for unlisted/nsfw toggles
2016-11-29Unify collection caching codeEugen Rochko
2016-11-25Remove stale entries from cache resultsEugen Rochko
2016-11-23Rename "publish" to "toot" in english locale, fix lightbox showing old imageEugen Rochko
before loading new one, cache notifications API, fix missing follow button on public profiles
2016-11-21Performance improvement for notifications APIEugen Rochko
2016-11-21Remove some n+1 queries from notifications APIEugen Rochko
2016-11-20Adding unified streamable notificationsEugen Rochko