mirror of
https://github.com/mastodon/mastodon.git
synced 2024-05-19 10:28:08 +00:00
Merge 33c1e2858e
into 5cd13ee4f1
This commit is contained in:
commit
6beee81f92
|
@ -6,7 +6,7 @@ class Web::NotificationSerializer < ActiveModel::Serializer
|
|||
include ActionView::Helpers::SanitizeHelper
|
||||
|
||||
attributes :access_token, :preferred_locale, :notification_id,
|
||||
:notification_type, :icon, :title, :body
|
||||
:notification_type, :icon, :display_name, :title, :body
|
||||
|
||||
def access_token
|
||||
current_push_subscription.associated_access_token
|
||||
|
@ -28,8 +28,12 @@ class Web::NotificationSerializer < ActiveModel::Serializer
|
|||
full_asset_url(object.from_account.avatar_static_url)
|
||||
end
|
||||
|
||||
def display_name
|
||||
object.from_account.display_name.presence || object.from_account.username
|
||||
end
|
||||
|
||||
def title
|
||||
I18n.t("notification_mailer.#{object.type}.subject", name: object.from_account.display_name.presence || object.from_account.username)
|
||||
I18n.t("notification_mailer.#{object.type}.subject", name: display_name)
|
||||
end
|
||||
|
||||
def body
|
||||
|
|
Loading…
Reference in a new issue