mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Implement edit functionality for post notices (#11140)
All post notice related custom fields were moved to a single one.
This commit is contained in:
@@ -616,10 +616,12 @@ class PostCreator
|
||||
.first
|
||||
|
||||
if !last_post_time
|
||||
@post.custom_fields[Post::NOTICE_TYPE] = Post.notices[:new_user]
|
||||
@post.custom_fields[Post::NOTICE] = { type: Post.notices[:new_user] }
|
||||
elsif SiteSetting.returning_users_days > 0 && last_post_time < SiteSetting.returning_users_days.days.ago
|
||||
@post.custom_fields[Post::NOTICE_TYPE] = Post.notices[:returning_user]
|
||||
@post.custom_fields[Post::NOTICE_ARGS] = last_post_time.iso8601
|
||||
@post.custom_fields[Post::NOTICE] = {
|
||||
type: Post.notices[:returning_user],
|
||||
last_posted_at: last_post_time.iso8601
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ class TopicView
|
||||
end
|
||||
|
||||
def self.default_post_custom_fields
|
||||
@default_post_custom_fields ||= [Post::NOTICE_TYPE, Post::NOTICE_ARGS, "action_code_who"]
|
||||
@default_post_custom_fields ||= [Post::NOTICE, "action_code_who"]
|
||||
end
|
||||
|
||||
def self.post_custom_fields_allowlisters
|
||||
|
||||
Reference in New Issue
Block a user