mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 07:37:55 +08:00
FIX: Add plugin event to topic list user lookup (#14116)
This can be used to change the list of topic posters. For example, discourse-solved can use this to move the user who posted the solution after the original poster.
This commit is contained in:
@ -210,6 +210,16 @@ class Plugin::Instance
|
||||
TopicView.add_custom_filter(trigger, &block)
|
||||
end
|
||||
|
||||
# Allows to add more user IDs to the list of preloaded users. This can be
|
||||
# useful to efficiently change the list of posters or participants.
|
||||
# Example usage:
|
||||
# register_topic_list_preload_user_ids do |topics, user_ids, topic_list|
|
||||
# user_ids << Discourse::SYSTEM_USER_ID
|
||||
# end
|
||||
def register_topic_list_preload_user_ids(&block)
|
||||
TopicList.on_preload_user_ids(&block)
|
||||
end
|
||||
|
||||
# Allow to eager load additional tables in Search. Useful to avoid N+1 performance problems.
|
||||
# Example usage:
|
||||
# register_search_topic_eager_load do |opts|
|
||||
|
Reference in New Issue
Block a user