discourse/plugins/chat/app/serializers/chat/base_thread_membership_serializer.rb
David Battersby 0c8f531909
FEATURE: encourage users to set chat thread titles (#26617)
This change encourages users to title their threads to make it easier for other users to join in on conversations that matter to them.

The creator of the chat thread will receive a toast notification prompting them to add a thread title when on mobile and the thread has at least 5 sent replies.
2024-04-29 17:20:01 +08:00

16 lines
500 B
Ruby
Vendored

# frozen_string_literal: true
module Chat
class BaseThreadMembershipSerializer < ApplicationSerializer
attributes :notification_level, :thread_id, :last_read_message_id, :thread_title_prompt_seen
def notification_level
Chat::UserChatThreadMembership.notification_levels[object.notification_level] ||
Chat::UserChatThreadMembership.notification_levels["normal"]
end
def thread_title_prompt_seen
object.try(:thread_title_prompt_seen) || false
end
end
end