forked from mastodon/mastodon
-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'parent/main' into upstream-20240326
- Loading branch information
Showing
263 changed files
with
4,637 additions
and
1,527 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
[production] | ||
defaults | ||
not IE 11 | ||
> 0.2% | ||
ios >= 15.6 | ||
not dead | ||
not OperaMini all | ||
|
||
[development] | ||
supports es6-module |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# frozen_string_literal: true | ||
|
||
class SeveredRelationshipsController < ApplicationController | ||
layout 'admin' | ||
|
||
before_action :authenticate_user! | ||
before_action :set_body_classes | ||
before_action :set_cache_headers | ||
|
||
before_action :set_event, only: [:following, :followers] | ||
|
||
def index | ||
@events = AccountRelationshipSeveranceEvent.where(account: current_account) | ||
end | ||
|
||
def following | ||
respond_to do |format| | ||
format.csv { send_data following_data, filename: "following-#{@event.target_name}-#{@event.created_at.to_date.iso8601}.csv" } | ||
end | ||
end | ||
|
||
def followers | ||
respond_to do |format| | ||
format.csv { send_data followers_data, filename: "followers-#{@event.target_name}-#{@event.created_at.to_date.iso8601}.csv" } | ||
end | ||
end | ||
|
||
private | ||
|
||
def set_event | ||
@event = AccountRelationshipSeveranceEvent.find(params[:id]) | ||
end | ||
|
||
def following_data | ||
CSV.generate(headers: ['Account address', 'Show boosts', 'Notify on new posts', 'Languages'], write_headers: true) do |csv| | ||
@event.severed_relationships.active.about_local_account(current_account).includes(:remote_account).reorder(id: :desc).each do |follow| | ||
csv << [acct(follow.target_account), follow.show_reblogs, follow.notify, follow.languages&.join(', ')] | ||
end | ||
end | ||
end | ||
|
||
def followers_data | ||
CSV.generate(headers: ['Account address'], write_headers: true) do |csv| | ||
@event.severed_relationships.passive.about_local_account(current_account).includes(:remote_account).reorder(id: :desc).each do |follow| | ||
csv << [acct(follow.account)] | ||
end | ||
end | ||
end | ||
|
||
def acct(account) | ||
account.local? ? account.local_username_and_domain : account.acct | ||
end | ||
|
||
def set_body_classes | ||
@body_classes = 'admin' | ||
end | ||
|
||
def set_cache_headers | ||
response.cache_control.replace(private: true, no_store: true) | ||
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
Oops, something went wrong.