Progress on DMs

Progress on DMs
This commit is contained in:
mgabdev
2020-12-19 01:33:33 -05:00
parent 47cd60f851
commit 7ec426e3d8
38 changed files with 447 additions and 197 deletions

View File

@@ -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