mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 12:25:06 +08:00
FEATURE: Featured topic for user profile & card (#8461)
This commit is contained in:

committed by
GitHub

parent
b5236591e9
commit
14cb386f1e
@ -123,4 +123,11 @@ module UserGuardian
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def can_feature_topic?(user, topic)
|
||||
return false if !SiteSetting.allow_featured_topic_on_user_profiles?
|
||||
return false if !is_me?(user) && !is_staff?
|
||||
return false if topic.read_restricted_category? || topic.private_message?
|
||||
topic.user_id === user.id
|
||||
end
|
||||
end
|
||||
|
@ -77,6 +77,7 @@ class PostDestroyer
|
||||
WebHook.enqueue_post_hooks(:post_destroyed, @post, payload)
|
||||
|
||||
if is_first_post
|
||||
UserProfile.remove_featured_topic_from_all_profiles(@topic)
|
||||
UserActionManager.topic_destroyed(topic)
|
||||
DiscourseEvent.trigger(:topic_destroyed, topic, @user)
|
||||
WebHook.enqueue_topic_hooks(:topic_destroyed, topic, topic_payload)
|
||||
|
@ -125,6 +125,7 @@ module SvgSprite
|
||||
"heading",
|
||||
"heart",
|
||||
"home",
|
||||
"id-card",
|
||||
"info-circle",
|
||||
"italic",
|
||||
"key",
|
||||
|
Reference in New Issue
Block a user