mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
added option that allows users to decide when they consider topics new (default 2 days old or newer)
added site_setting to control the default new_topic_duration_minutes added 10 minutes option for auto_track_topics_after_msecs, default bumped up to 5 mins
This commit is contained in:
@@ -18,14 +18,7 @@ class BasicTopicSerializer < ApplicationSerializer
|
||||
return false if scope.blank?
|
||||
return false if scope.user.blank?
|
||||
return false if object.user_data.present?
|
||||
return false if object.created_at < scope.user.created_at
|
||||
|
||||
# Only mark things as new since your last visit
|
||||
if scope.user.previous_visit_at.present?
|
||||
return false if object.created_at < scope.user.previous_visit_at
|
||||
end
|
||||
|
||||
|
||||
return false if object.created_at < scope.user.treat_as_new_topic_start_date
|
||||
true
|
||||
end
|
||||
|
||||
|
||||
@@ -43,11 +43,16 @@ class UserSerializer < BasicUserSerializer
|
||||
:email_private_messages,
|
||||
:email_direct,
|
||||
:digest_after_days,
|
||||
:auto_track_topics_after_msecs
|
||||
:auto_track_topics_after_msecs,
|
||||
:new_topic_duration_minutes
|
||||
|
||||
def auto_track_topics_after_msecs
|
||||
object.auto_track_topics_after_msecs || SiteSetting.auto_track_topics_after
|
||||
end
|
||||
|
||||
def new_topic_duration_minutes
|
||||
object.new_topic_duration_minutes || SiteSetting.new_topic_duration_minutes
|
||||
end
|
||||
|
||||
def can_send_private_message_to_user
|
||||
scope.can_send_private_message?(object)
|
||||
|
||||
Reference in New Issue
Block a user