Progress on DMs
Progress on DMs
This commit is contained in:
@@ -24,4 +24,23 @@ class REST::ChatConversationAccountSerializer < ActiveModel::Serializer
|
||||
object.unread_count > 0
|
||||
end
|
||||
|
||||
def chat_message_expiration_policy
|
||||
case object.chat_message_expiration_policy
|
||||
when ChatConversationAccount::EXPIRATION_POLICY_MAP[:five_minutes]
|
||||
return 'five_minutes'
|
||||
when ChatConversationAccount::EXPIRATION_POLICY_MAP[:one_hour]
|
||||
return 'one_hour'
|
||||
when ChatConversationAccount::EXPIRATION_POLICY_MAP[:six_hours]
|
||||
return 'six_hours'
|
||||
when ChatConversationAccount::EXPIRATION_POLICY_MAP[:one_day]
|
||||
return 'one_day'
|
||||
when ChatConversationAccount::EXPIRATION_POLICY_MAP[:three_days]
|
||||
return 'three_days'
|
||||
when ChatConversationAccount::EXPIRATION_POLICY_MAP[:one_week]
|
||||
return 'one_week'
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
18
app/serializers/rest/chat_messenger_blocked_serializer.rb
Normal file
18
app/serializers/rest/chat_messenger_blocked_serializer.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class REST::ChatMessengerBlockedSerializer < ActiveModel::Serializer
|
||||
attributes :target_id, :chat_blocking, :chat_blocked_by
|
||||
|
||||
def target_id
|
||||
object.id.to_s
|
||||
end
|
||||
|
||||
def chat_blocking
|
||||
instance_options[:chat_blocking] || false
|
||||
end
|
||||
|
||||
def chat_blocked_by
|
||||
instance_options[:chat_blocked_by] || false
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user