forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2834 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes up to c9ea91f
- Loading branch information
Showing
92 changed files
with
854 additions
and
502 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
--color | ||
--require spec_helper | ||
--format Fuubar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
ffmpeg | ||
libopenblas0-pthread | ||
libpq-dev | ||
libxdamage1 | ||
libxfixes3 | ||
libidn12 | ||
# for idn-ruby on heroku-24 stack | ||
|
||
# use https://github.com/heroku/heroku-buildpack-activestorage-preview | ||
# in place for ffmpeg and its dependent packages to reduce slag size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
app/controllers/api/v2_alpha/notifications/accounts_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# frozen_string_literal: true | ||
|
||
class Api::V2Alpha::Notifications::AccountsController < Api::BaseController | ||
before_action -> { doorkeeper_authorize! :read, :'read:notifications' } | ||
before_action :require_user! | ||
before_action :set_notifications! | ||
after_action :insert_pagination_headers, only: :index | ||
|
||
def index | ||
@accounts = load_accounts | ||
render json: @accounts, each_serializer: REST::AccountSerializer | ||
end | ||
|
||
private | ||
|
||
def load_accounts | ||
@paginated_notifications.map(&:from_account) | ||
end | ||
|
||
def set_notifications! | ||
@paginated_notifications = begin | ||
current_account | ||
.notifications | ||
.without_suspended | ||
.where(group_key: params[:notification_group_key]) | ||
.includes(from_account: [:account_stat, :user]) | ||
.paginate_by_max_id( | ||
limit_param(DEFAULT_ACCOUNTS_LIMIT), | ||
params[:max_id], | ||
params[:since_id] | ||
) | ||
end | ||
end | ||
|
||
def next_path | ||
api_v2_alpha_notification_accounts_url pagination_params(max_id: pagination_max_id) if records_continue? | ||
end | ||
|
||
def prev_path | ||
api_v2_alpha_notification_accounts_url pagination_params(min_id: pagination_since_id) unless @paginated_notifications.empty? | ||
end | ||
|
||
def pagination_collection | ||
@paginated_notifications | ||
end | ||
|
||
def records_continue? | ||
@paginated_notifications.size == limit_param(DEFAULT_ACCOUNTS_LIMIT) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.