about summary refs log tree commit diff
path: root/app/controllers
AgeCommit message (Collapse)Author
2017-05-25More use of next link header on account (media) timelines (#3311)unarist
This will reduce requests on who have only few statuses. - Use next link header to detect more items from first request - Omit next link header if result items are fewer than requested count (It had omit it only if result was empty before)
2017-05-24Show error message to suspended user (#3281)Yamagishi Kazutoshi
2017-05-23Fix following/followers API to return correct link headers (#3268)unarist
Link headers in following/followers API should include follow_id as max_id/since_id. However, these API use current_user's account_id instead of follow_id from #3167. This causes irrelevant result on loading more users.
2017-05-23Fix Devise destroy method being available to delete user record (#3266)Eugen Rochko
(You may think that we need account deletions, but this way would've just orphaned the db records)
2017-05-23Toggle sensitive from admin page (#3261)alpaca-tc
2017-05-23Refactor of API timeline actions (#3263)Matt Jankowski
- Increase coverage to exercise all parts of each action - Move into namespace to share common code - Misc refactor of each action for smaller methods, simpler code
2017-05-23Cover StreamEntriesController more and remove redundant instructions (#3257)Akihiko Odaki
* Cover StreamEntriesController more * Remove redundant instructions in StreamEntriesController
2017-05-23Introduce recent to Follow (#3247)Akihiko Odaki
Introduce recent to Follow, as Account and other models have. This change also adds specs for the scope and the dependents.
2017-05-23Cover AccountsController more in spec (#3229)Akihiko Odaki
* Introduce recent scope to Status and StreamEntry Introduce recent scope to Status and StreamEntry as Account has. * Cover AccountsController more in AccountsController
2017-05-22Coverage for api/web/settings controller (#3238)Matt Jankowski
2017-05-22Fix locale bug when change it on preferences (#3223) (#3232)Tomonori Murakami
2017-05-22Allow alternate domains for mastodon handlers (#3187)Immae
2017-05-22Change "Account.any?" to "Account.exists?" (#3217)Yamagishi Kazutoshi
2017-05-22single_user_mode? always returns boolean (#3215)Akihiko Odaki
This change also adds a specification for the method.
2017-05-21Fix mutes_controller error and incorrect statuses_controller report (#3202)Akihiko Odaki
This commit fixes a regression in commit f55480756337dd4df7513e89673e81e003f1201a.
2017-05-20Fix regressions in api/v1 (#3178)Akihiko Odaki
The regressions are introduced at commit f55480756337dd4df7513e89673e81e003f1201a by me (Akihiko Odaki)
2017-05-20Filter languages with opt out (#3175)Matt Jankowski
* Remove allowed_languages and add filtered_languages * Use filtered_languages instead of allowed_languages
2017-05-20Fix block list 500 (#3174)Yamagishi Kazutoshi
2017-05-20Use joins for account properties (#3167)Akihiko Odaki
2017-05-19Add buttons to block and unblock domain (#3127)Eugen Rochko
* Add buttons to block and unblock domain * Relationship API now returns "domain_blocking" status for accounts, rename "block entire domain" to "hide entire domain", fix unblocking domain, do not block notifications from domain-blocked-but-followed people, do not send Salmons to domain blocked users * Add test * Personal domain blocks shouldn't affect Salmon after all, since in this direction of communication the control is very thin when it comes to public stuff. Best stay consistent and not affect federation in this way * Ignore followers and follow request from domain blocked folks, ensure account domain blocks are not created for empty domain, and avoid duplicates in validation * Purge followers when blocking domain (without soft-blocks, since they are useless here) * Add tests, fix local timeline being empty when having any domain blocks
2017-05-19Conditional validations no longer accept strings for if/unless (#3124)Matt Jankowski
2017-05-19Account domain blocks (#2381)Eugen Rochko
* Add <ostatus:conversation /> tag to Atom input/output Only uses ref attribute (not href) because href would be the alternate link that's always included also. Creates new conversation for every non-reply status. Carries over conversation for every reply. Keeps remote URIs verbatim, generates local URIs on the fly like the rest of them. * Conversation muting - prevents notifications that reference a conversation (including replies, favourites, reblogs) from being created. API endpoints /api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute Currently no way to tell when a status/conversation is muted, so the web UI only has a "disable notifications" button, doesn't work as a toggle * Display "Dismiss notifications" on all statuses in notifications column, not just own * Add "muted" as a boolean attribute on statuses JSON For now always false on contained reblogs, since it's only relevant for statuses returned from the notifications endpoint, which are not nested Remove "Disable notifications" from detailed status view, since it's only relevant in the notifications column * Up max class length * Remove pending test for conversation mute * Add tests, clean up * Rename to "mute conversation" and "unmute conversation" * Raise validation error when trying to mute/unmute status without conversation * Adding account domain blocks that filter notifications and public timelines * Add tests for domain blocks in notifications, public timelines Filter reblogs of blocked domains from home * Add API for listing and creating account domain blocks * API for creating/deleting domain blocks, tests for Status#ancestors and Status#descendants, filter domain blocks from them * Filter domains in streaming API * Update account_domain_block_spec.rb
2017-05-17Add filter to AccountFilter (#2968)alpaca-tc
2017-05-16use-symbol-in-order (#3081)masarakki
2017-05-15Feature conversations muting (#3017)Eugen Rochko
* Add <ostatus:conversation /> tag to Atom input/output Only uses ref attribute (not href) because href would be the alternate link that's always included also. Creates new conversation for every non-reply status. Carries over conversation for every reply. Keeps remote URIs verbatim, generates local URIs on the fly like the rest of them. * Conversation muting - prevents notifications that reference a conversation (including replies, favourites, reblogs) from being created. API endpoints /api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute Currently no way to tell when a status/conversation is muted, so the web UI only has a "disable notifications" button, doesn't work as a toggle * Display "Dismiss notifications" on all statuses in notifications column, not just own * Add "muted" as a boolean attribute on statuses JSON For now always false on contained reblogs, since it's only relevant for statuses returned from the notifications endpoint, which are not nested Remove "Disable notifications" from detailed status view, since it's only relevant in the notifications column * Up max class length * Remove pending test for conversation mute * Add tests, clean up * Rename to "mute conversation" and "unmute conversation" * Raise validation error when trying to mute/unmute status without conversation
2017-05-09Specs for API push controller, with refactor (#2926)Matt Jankowski
* Coverage for api push controller * Refactor the api/push controller
2017-05-08Remove unnecessary keep file. (#2902)HANATANI Takuma
2017-05-06Refactor domain_blocks_controller (#2843)alpaca-tc
* Set domain_block by before_action * Cast value with ActiveRecord::Type * Batch update
2017-05-06Use null as default oEmbed height (#2842)rch850
Height 640 is too big for most toots. Twitter use null value to support flexible height.
2017-05-06Optimize follower_accounts and following_accounts (#2820)alpaca-tc
2017-05-04Replace best_in_place editor on admin settings page (#2789)Matt Jankowski
* Remove best_in_place * Replace best_in_place usage with rails helpers * Move admin/settings#index to #edit action * Remove click_to__edit from i18n
2017-05-03Fix #2706 - Always respond with 200 to PuSH payloads (#2733)Eugen Rochko
Fix #2196 - Respond with 201 when Salmon accepted, 400 when unverified Fix #2629 - Correctly handle confirm_domain? for local accounts Unify rules for extracting author acct from XML, prefer <email>, fall back to <name> + <uri> (see also #2017, #2172)
2017-05-02Auth sign out (#2511)Matt Jankowski
* Add a spec for signing out * Add spec showing that suspended user gets a 403 forbidden on sign out * Allow suspended account users to sign out
2017-05-02Add option to disable two factor auth in admin accounts panel. (#2584)Kaylee
* Add option to disable two factor auth in admin accounts panel. Closes #2578 * Add @mjankowski's suggestions. * Moves destroy actions behind User#disable_two_factor! * Adds spec coverage for Admin:TwoFactorAuthenticationsController and User#disable_two_factor!
2017-05-02Add admin area view partials for each record type (#2700)Matt Jankowski
2017-05-02Coverage for remote follows (#2694)Matt Jankowski
* Add coverage for create with empty acct value * Add coverage for create with webfinger failure * Add coverage for create with webfinger providing bad values * Add coverage for create when webfinger is good * Add coverage for session[:remote_follow] having data * Simplify how remote follow pulls acct from session * Remote follow behaves more like model * Move the discovery portions of remote follow out of controller * Check for suspended accounts
2017-05-01Error responses cleanup (#2692)Matt Jankowski
* Use respond_with_error for forbidden errors * Wrap up common error code into single method
2017-05-01Filter on allowed user language preferences (#2361)Matt Jankowski
* Naive approached to timeline filtering * Convert allowed_languages into a db column * Allow users to choose languages to see statuses in * Style list items as two columns * Add a hint to explain language filtering preference
2017-05-01Fix Rubocop offences (#2630)yhirano
* disable Bundler/OrderedGems * fix rubocop Lint/UselessAssignment * fix rubocop Style/BlockDelimiters * fix rubocop Style/AlignHash * fix rubocop Style/AlignParameters, Style/EachWithObject * fix rubocop Style/SpaceInLambdaLiteral
2017-04-30Extract user tracking into concern (#2600)Matt Jankowski
2017-04-30More coverage yes more even more (#2627)Matt Jankowski
* Add coverage for admin/confirmations controller * Coverage for statuses controller show action * Add coverage for admin/domain_blocks controller * Add coverage for settings/profiles#update
2017-04-30Downgrade rubocop 0.48.1 => 0.46.0 (#2628)yhirano
* downgrade rubocop 0.48.1 => 0.46.0 * exclude vendor/**/* from rubocop target files * add frozen_string_literal comment line * fix percent literal delimited by ( and ) * fix alignment * remove comment disabling unknown cop
2017-04-29Remove uneeded `ORDER BY` query (#2615)alpaca-tc
2017-04-28Return missing page when tag does not exist (#2563)Matt Jankowski
2017-04-27Fix Doorkeeper error (#2534)Yamagishi Kazutoshi
* Fix Doorkeeper error * use Doorkeeper::OAuth::Scopes.from_string
2017-04-27Catch error when server decryption fails on 2FA (#2512)Matt Jankowski
2017-04-27OEmbed support for PreviewCard (#2337)Eugen Rochko
* OEmbed support for PreviewCard * Improve ProviderDiscovery code failure treatment * Do not crawl links if there is a content warning, since those don't display a link card anyway * Reset db schema * Fresh migrate * Fix rubocop style issues Fix #1681 - return existing access token when applicable instead of creating new * Fix test * Extract http client to helper * Improve oembed controller
2017-04-27Add spec coverage and refactor authorize_follows controller (#2505)Matt Jankowski
2017-04-25Localize with i18n for Devise::FailureApp (#2309)alpaca-tc
This PR fixes I18n.locale for rake middlewares. Mastodon uses Devise that depends on Warden. Warden::Manager can be found in rake middleware. It is outside of the controller. In the case of authentication failed, warden calls throw(:warden). At the time Warden::Manager delegates request to failure_app to generate response and flash[:alert] after catching it. Unfortunately, I18n.locale is already reset then because I18n.with_locale is enabled only inside the controller. If we used I18n.locale=, Devise::FailureApp could get the current locale.
2017-04-25Change ActivityPub paging to match spec. Clean up ActivityPub outbox ↵Evan Minto
changes. (#2410) * Change ActivityPub paging to match spec. Clean up ActivityPub outbox changes. * Fix code style and test failures for OutboxController. * Attempt to fix CI errors.