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.
* Fix mastodon version * テーブル作成 * Wip: フレンドサーバーフォローの承認を受信 * Wip: フレンド申請拒否を受信 * Wip: フォローリクエストを受理 * Wip: 相手からのフォロー・アンフォローを受理 * 普通のフォローとフレンドサーバーのフォローを区別するテストを追加 * ドメインブロックによるフォロー拒否 * ドメインブロックしたあと、申請中のフォロリクを取り下げる処理 * スタブに条件を追加 * Wip: 相手からのDelete信号に対応 * DB定義が消えていたので修正 * Wip: ローカル公開投稿をフレンドに送信する処理など * Wip: 未収載+誰でもの投稿をフレンドに送る設定 * Wip: ローカル公開をそのまま送信する設定を考慮 * Fix test * Wip: 他サーバーからのローカル公開投稿の受け入れ * Wip: Web画面作成 * Fix test * Wip: ローカル公開を連合TLに流す * Wip: フレンドサーバーの削除ボタン * Wip: メール通知や設定のテストなど * Wip: 翻訳を作成 * Fix: 却下されたあとフォローボタンが表示されない問題 * Wip: 編集できない問題 * 有効にしていないフレンドサーバーをリストで無効表示
- Loading branch information
Showing
66 changed files
with
1,638 additions
and
51 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 |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# frozen_string_literal: true | ||
|
||
module Admin | ||
class FriendServersController < BaseController | ||
before_action :set_friend, except: [:index, :new, :create] | ||
before_action :warn_signatures_not_enabled!, only: [:new, :edit, :create, :follow, :unfollow, :accept, :reject] | ||
|
||
def index | ||
authorize :friend_server, :update? | ||
@friends = FriendDomain.all | ||
end | ||
|
||
def new | ||
authorize :friend_server, :update? | ||
@friend = FriendDomain.new | ||
end | ||
|
||
def edit | ||
authorize :friend_server, :update? | ||
end | ||
|
||
def create | ||
authorize :friend_server, :update? | ||
|
||
@friend = FriendDomain.new(resource_params) | ||
|
||
if @friend.save | ||
@friend.follow! | ||
redirect_to admin_friend_servers_path | ||
else | ||
render action: :new | ||
end | ||
end | ||
|
||
def update | ||
authorize :friend_server, :update? | ||
|
||
if @friend.update(resource_params) | ||
redirect_to admin_friend_servers_path | ||
else | ||
render action: :edit | ||
end | ||
end | ||
|
||
def destroy | ||
authorize :friend_server, :update? | ||
@friend.destroy | ||
redirect_to admin_friend_servers_path | ||
end | ||
|
||
def follow | ||
authorize :friend_server, :update? | ||
@friend.follow! | ||
render action: :edit | ||
end | ||
|
||
def unfollow | ||
authorize :friend_server, :update? | ||
@friend.unfollow! | ||
render action: :edit | ||
end | ||
|
||
def accept | ||
authorize :friend_server, :update? | ||
@friend.accept! | ||
render action: :edit | ||
end | ||
|
||
def reject | ||
authorize :friend_server, :update? | ||
@friend.reject! | ||
render action: :edit | ||
end | ||
|
||
private | ||
|
||
def set_friend | ||
@friend = FriendDomain.find(params[:id]) | ||
end | ||
|
||
def resource_params | ||
params.require(:friend_domain).permit(:domain, :inbox_url, :available, :pseudo_relay, :unlocked, :allow_all_posts) | ||
end | ||
|
||
def warn_signatures_not_enabled! | ||
flash.now[:error] = I18n.t('admin.relays.signatures_not_enabled') if authorized_fetch_mode? | ||
end | ||
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
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.