nas/app/mailers/admin_mailer.rb
KMY(雪あすか) 87e858a202
Add: フレンドサーバー (#61)
* 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: 編集できない問題

* 有効にしていないフレンドサーバーをリストで無効表示
2023-10-09 11:51:15 +09:00

81 lines
1.7 KiB
Ruby

# frozen_string_literal: true
class AdminMailer < ApplicationMailer
layout 'plain_mailer'
helper :accounts
helper :languages
before_action :process_params
before_action :set_instance
default to: -> { @me.user_email }
def new_report(report)
@report = report
locale_for_account(@me) do
mail subject: default_i18n_subject(instance: @instance, id: @report.id)
end
end
def new_appeal(appeal)
@appeal = appeal
locale_for_account(@me) do
mail subject: default_i18n_subject(instance: @instance, username: @appeal.account.username)
end
end
def new_pending_account(user)
@account = user.account
locale_for_account(@me) do
mail subject: default_i18n_subject(instance: @instance, username: @account.username)
end
end
def new_pending_friend_server(friend_server)
@friend = friend_server
locale_for_account(@me) do
mail subject: default_i18n_subject(instance: @instance, domain: @friend.domain)
end
end
def new_trends(links, tags, statuses)
@links = links
@tags = tags
@statuses = statuses
locale_for_account(@me) do
mail subject: default_i18n_subject(instance: @instance)
end
end
def new_software_updates
locale_for_account(@me) do
mail subject: default_i18n_subject(instance: @instance)
end
end
def new_critical_software_updates
headers['Priority'] = 'urgent'
headers['X-Priority'] = '1'
headers['Importance'] = 'high'
locale_for_account(@me) do
mail subject: default_i18n_subject(instance: @instance)
end
end
private
def process_params
@me = params[:recipient]
end
def set_instance
@instance = Rails.configuration.x.local_domain
end
end