Progress
This commit is contained in:
@@ -4,7 +4,7 @@ class REST::AccountSerializer < ActiveModel::Serializer
|
||||
include RoutingHelper
|
||||
|
||||
attributes :id, :username, :acct, :display_name, :locked, :bot, :created_at,
|
||||
:note, :url, :avatar, :avatar_static, :header, :header_static,
|
||||
:note, :url, :avatar, :avatar_static, :header, :header_static, :is_flagged_as_spam,
|
||||
:followers_count, :following_count, :statuses_count, :is_pro, :is_verified, :is_donor, :is_investor
|
||||
|
||||
has_one :moved_to_account, key: :moved, serializer: REST::AccountSerializer, if: :moved_and_not_nested?
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class REST::ChatConversationAccountSerializer < ActiveModel::Serializer
|
||||
attributes :id, :is_hidden, :is_approved, :unread_count, :is_unread, :chat_conversation_id, :created_at
|
||||
attributes :id, :is_hidden, :is_approved, :unread_count,
|
||||
:is_unread, :chat_conversation_id, :created_at,
|
||||
:is_blocked, :is_muted, :chat_message_expiration_policy
|
||||
|
||||
has_many :participant_accounts, key: :other_accounts, serializer: REST::AccountSerializer
|
||||
has_one :last_chat_message, serializer: REST::ChatMessageSerializer, unless: :last_chat_message_id?
|
||||
@@ -22,4 +24,12 @@ class REST::ChatConversationAccountSerializer < ActiveModel::Serializer
|
||||
object.unread_count > 0
|
||||
end
|
||||
|
||||
def is_blocked
|
||||
false
|
||||
end
|
||||
|
||||
def is_muted
|
||||
false
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
class REST::ChatMessageSerializer < ActiveModel::Serializer
|
||||
attributes :id, :text_html, :text, :language, :from_account_id,
|
||||
:chat_conversation_id, :created_at
|
||||
:chat_conversation_id, :created_at, :expires_at
|
||||
|
||||
def id
|
||||
object.id.to_s
|
||||
|
||||
Reference in New Issue
Block a user