mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-27 00:42:45 +08:00
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.
16 lines
500 B
Ruby
Vendored
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
|