Commit Graph

12 Commits (65cea8f89f7c6453e6709f834a39b4552a330743)

Author SHA1 Message Date
Matt Jankowski 85d9053b36
Move `pagination_params` into `API::BaseController` (#28845) 7 months ago
Eugen Rochko 128987eded
Add support for `fediverse:creator` OpenGraph tag (#30398) 7 months ago
Matt Jankowski b5115850bb
Move repeated `insert_pagination_headers` method to api base class (#29606) 10 months ago
Eugen Rochko 0d14fcebae
Change link previews to keep original URL from the status (#27312) 1 year ago
Claire 1d622c8033
Add POST /api/v1/conversations/:id/unread (#25509) 2 years ago
Claire ec59166844
Fix ArgumentError when loading newer Private Mentions (#25399) 2 years ago
Claire 2b45fecde1
Fix multiple N+1s in ConversationsController (#25134) 2 years ago
Nick Schonning e2a3ebb271
Autofix Rubocop Style/IfUnlessModifier (#23697) 2 years ago
Akihiko Odaki ae871c4d46
Make Array-creation behavior of Paginable more predictable (#14687)
* Make Array-creation behavior of Paginable more predictable

Paginable.paginate_by_id usually returns ActiveRecord::Relation, but it
returns an Array if min_id option is present. The behavior caused problems
fixed with the following commits:
- 552e886b64
- b63ede5005
- 64ef37b89d

To prevent from recurring similar problems, this commit introduces two
changes:
- The scope now always returns an Array whether min_id option is present
  or not.
- The scope is renamed to to_a_paginated_by_id to clarify it returns an
  Array.

* Transform Paginable.to_a_paginated_by_id from a scope to a class method

https://api.rubyonrails.org/classes/ActiveRecord/Scoping/Named/ClassMethods.html#method-i-scope
> The method is intended to return an ActiveRecord::Relation object, which
> is composable with other scopes.

Paginable.to_a_paginated_by_id returns an Array and is not appropriate
as a scope.
4 years ago
Eugen Rochko 0ae5c6312f
Remove useless `respond_to` calls (#13208) 5 years ago
Eugen Rochko a38a452481
Add unread indicator to conversations (#9009) 6 years ago
Eugen Rochko 774ac47373
Add conversations API (#8832)
* Add conversations API

* Add web UI for conversations

* Add test for conversations API

* Add tests for ConversationAccount

* Improve web UI

* Rename ConversationAccount to AccountConversation

* Remove conversations on block and mute

* Change last_status_id to be a denormalization of status_ids

* Add optimistic locking
6 years ago