forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix conflict * Update locale files * mastodon#6109 PR removed
- Loading branch information
Showing
190 changed files
with
4,848 additions
and
534 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
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,22 @@ | ||
# frozen_string_literal: true | ||
|
||
class ActivityPub::FollowsController < Api::BaseController | ||
include SignatureVerification | ||
|
||
def show | ||
render json: follow_request, | ||
serializer: ActivityPub::FollowSerializer, | ||
adapter: ActivityPub::Adapter, | ||
content_type: 'application/activity+json' | ||
end | ||
|
||
private | ||
|
||
def follow_request | ||
FollowRequest.includes(:account).references(:account).find_by!( | ||
id: params.require(:id), | ||
accounts: { domain: nil, username: params.require(:account_username) }, | ||
target_account: signed_request_account | ||
) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# frozen_string_literal: true | ||
|
||
class Api::V1::Instances::ActivityController < Api::BaseController | ||
before_action :require_enabled_api! | ||
|
||
respond_to :json | ||
|
||
def show | ||
render_cached_json('api:v1:instances:activity:show', expires_in: 1.day) { activity } | ||
end | ||
|
||
private | ||
|
||
def activity | ||
weeks = [] | ||
|
||
12.times do |i| | ||
day = i.weeks.ago.to_date | ||
week_id = day.cweek | ||
week = Date.commercial(day.cwyear, week_id) | ||
|
||
weeks << { | ||
week: week.to_time.to_i.to_s, | ||
statuses: Redis.current.get("activity:statuses:local:#{week_id}") || 0, | ||
logins: Redis.current.pfcount("activity:logins:#{week_id}"), | ||
registrations: Redis.current.get("activity:accounts:local:#{week_id}") || 0, | ||
} | ||
end | ||
|
||
weeks | ||
end | ||
|
||
def require_enabled_api! | ||
head 404 unless Setting.activity_api_enabled | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
class Api::V1::Instances::PeersController < Api::BaseController | ||
before_action :require_enabled_api! | ||
|
||
respond_to :json | ||
|
||
def index | ||
render_cached_json('api:v1:instances:peers:index', expires_in: 1.day) { Account.remote.domains } | ||
end | ||
|
||
private | ||
|
||
def require_enabled_api! | ||
head 404 unless Setting.peers_api_enabled | ||
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 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
Oops, something went wrong.