Skip to content

DEV: remove educational tips and associated site settings #33012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions config/locales/server.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -697,24 +697,6 @@ en:

For more tips and advice on participating in our community, [check out our community guidelines](%{base_path}/guidelines).

avatar: |
### How about a picture for your account?

You’ve posted a few topics and replies, but your profile picture isn’t as unique as you are – it’s just a letter.

Have you considered **[visiting your user profile](%{profile_path})** and uploading a picture that represents you?

It’s easier to follow discussions and find interesting people in conversations when everyone has a unique profile picture!

sequential_replies: |
### Consider replying to several posts at once

Rather than several replies to a topic in a row, please consider a single reply that includes quotes from previous posts or @name references.

You can edit your previous reply to add a quote by highlighting text and selecting the <b>quote reply</b> button that appears.

It’s easier for everyone to read topics that have fewer in-depth replies versus lots of small, individual replies.

dominating_topic: You've posted a lot in this topic! Consider giving others an opportunity to participate, too.

get_a_room:
Expand All @@ -726,13 +708,6 @@ en:
too_many_replies: |
New users are temporarily limited to %{newuser_max_replies_per_topic} replies in the same topic. Please consider visiting other topics to keep getting to know the community.

reviving_old_topic: |
### Revive this topic?

The last reply to this topic was **%{time_ago}**. Your reply will bump the topic to the top of its list and notify anyone previously involved in the conversation.

Are you sure you want to continue this old conversation?

activerecord:
attributes:
category:
Expand Down Expand Up @@ -2472,8 +2447,6 @@ en:

allow_profile_backgrounds: "Allow users to upload profile backgrounds."

sequential_replies_threshold: "Number of posts a user has to make in a row in a topic before being reminded about too many sequential replies."

get_a_room_threshold: "Number of posts a user has to make to the same person in the same topic before being warned."

dont_feed_the_trolls_threshold: "Number of flags from other users before being warned."
Expand All @@ -2482,8 +2455,6 @@ en:

dominating_topic_minimum_percent: "What percentage of posts a user has to make in a topic before being reminded about overly dominating a topic."

disable_avatar_education_message: "Disable education message for changing avatar."

pm_warn_user_last_seen_months_ago: "When creating a new PM warn users when target recepient has not been seen more than n months ago."

suppress_uncategorized_badge: "Don't show the badge for uncategorized topics in topic lists."
Expand Down Expand Up @@ -2536,7 +2507,6 @@ en:
show_time_gap_days: "If two posts are made this many days apart, display the time gap in the topic."
short_progress_text_threshold: "After the number of posts in a topic goes above this number, the progress bar will only show the current post number. If you change the progress bar's width, you may need to change this value."
default_code_lang: "Default programming language syntax highlighting applied to markdown code blocks (auto, text, ruby, python etc.). This value must also be present in the `highlighted languages` site setting."
warn_reviving_old_topic_age: "When someone starts replying to a topic where the last reply is older than this many days, a warning will be displayed. Disable by setting to 0."
autohighlight_all_code: "Apply syntax highlighting to HTML-authored &lt;code&gt; blocks, even if they didn't specify a language. To configure markdown-authored code blocks, use the 'default code lang' setting."
highlighted_languages: "Included syntax highlighting rules. (Warning: including too many languages may impact performance) see: <a href='https://highlightjs.org/demo/' target='_blank'>https://highlightjs.org/demo</a> for a demo"
show_copy_button_on_codeblocks: "Add a button to codeblocks to copy the block contents to the user's clipboard."
Expand Down
9 changes: 0 additions & 9 deletions config/site_settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1372,9 +1372,6 @@ posting:
client: true
default: "auto"
area: "posts_and_topics"
warn_reviving_old_topic_age:
default: 180
area: "posts_and_topics"
autohighlight_all_code:
client: true
default: false
Expand Down Expand Up @@ -3283,9 +3280,6 @@ uncategorized:
educate_until_posts:
default: 2
area: "users"
sequential_replies_threshold:
default: 2
area: "stats_and_thresholds"
get_a_room_threshold:
default: 3
area: "stats_and_thresholds"
Expand All @@ -3295,9 +3289,6 @@ uncategorized:
dominating_topic_minimum_percent:
default: 40
area: "stats_and_thresholds"
disable_avatar_education_message:
default: false
area: "users"
pm_warn_user_last_seen_months_ago:
default: 24
area: "users"
Expand Down
104 changes: 0 additions & 104 deletions lib/composer_messages_finder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,83 +74,6 @@ def check_new_user_many_replies
}
end

# Should a user be contacted to update their avatar?
def check_avatar_notification
# A user has to be basic at least to be considered for an avatar notification
return unless @user.has_trust_level?(TrustLevel[1])

# We don't notify users who have avatars or who have been notified already.
if @user.uploaded_avatar_id || UserHistory.exists_for_user?(@user, :notified_about_avatar)
return
end

# Do not notify user if any of the following is true:
# - "disable avatar education message" is enabled
# - "sso overrides avatar" is enabled
# - "allow uploaded avatars" is disabled
if SiteSetting.disable_avatar_education_message ||
SiteSetting.discourse_connect_overrides_avatar ||
!@user.in_any_groups?(SiteSetting.uploaded_avatars_allowed_groups_map)
return
end

# If we got this far, log that we've nagged them about the avatar
UserHistory.create!(
action: UserHistory.actions[:notified_about_avatar],
target_user_id: @user.id,
)

# Return the message
{
id: "avatar",
templateName: "education",
body:
PrettyText.cook(
I18n.t(
"education.avatar",
profile_path: "/u/#{@user.username_lower}/preferences/account#profile-picture",
),
),
}
end

# Is a user replying too much in succession?
def check_sequential_replies
return unless educate_reply?(:notified_about_sequential_replies)

# Count the posts made by this user in the last day
recent_posts_user_ids =
Post
.where(topic_id: @details[:topic_id])
.where("created_at > ?", 1.day.ago)
.where(post_type: Post.types[:regular])
.order("created_at desc")
.limit(SiteSetting.sequential_replies_threshold)
.pluck(:user_id)

# Did we get back as many posts as we asked for, and are they all by the current user?
if recent_posts_user_ids.size != SiteSetting.sequential_replies_threshold ||
recent_posts_user_ids.detect { |u| u != @user.id }
return
end

# If we got this far, log that we've nagged them about the sequential replies
UserHistory.create!(
action: UserHistory.actions[:notified_about_sequential_replies],
target_user_id: @user.id,
topic_id: @details[:topic_id],
)

{
id: "sequential_replies",
templateName: "education",
wait_for_typing: true,
extraClass: "education-message",
hide_if_whisper: true,
body: PrettyText.cook(I18n.t("education.sequential_replies")),
}
end

def check_dominating_topic
return unless educate_reply?(:notified_about_dominating_topic)

Expand Down Expand Up @@ -254,33 +177,6 @@ def check_dont_feed_the_trolls
}
end

def check_reviving_old_topic
return unless replying?
if @topic.nil? || SiteSetting.warn_reviving_old_topic_age < 1 || @topic.last_posted_at.nil? ||
@topic.last_posted_at > SiteSetting.warn_reviving_old_topic_age.days.ago
return
end

{
id: "reviving_old",
templateName: "education",
wait_for_typing: false,
extraClass: "education-message",
body:
PrettyText.cook(
I18n.t(
"education.reviving_old_topic",
time_ago:
AgeWords.time_ago_in_words(
@topic.last_posted_at,
false,
scope: :"datetime.distance_in_words_verbose",
),
),
),
}
end

def self.user_not_seen_in_a_while(usernames)
User
.where(username_lower: usernames)
Expand Down
Loading
Loading