mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 11:24:38 +08:00
FEATURE: Allow staffs to tag PMs
This commit is contained in:
@ -269,6 +269,14 @@ class TopicQuery
|
||||
create_list(:private_messages, {}, list)
|
||||
end
|
||||
|
||||
def list_private_messages_tag(user)
|
||||
list = private_messages_for(user, :all)
|
||||
tag_id = Tag.where('name ilike ?', @options[:tags][0]).pluck(:id).first
|
||||
list = list.joins("JOIN topic_tags tt ON tt.topic_id = topics.id AND
|
||||
tt.tag_id = #{tag_id}")
|
||||
create_list(:private_messages, {}, list)
|
||||
end
|
||||
|
||||
def list_category_topic_ids(category)
|
||||
query = default_results(category: category.id)
|
||||
pinned_ids = query.where('pinned_at IS NOT NULL AND category_id = ?', category.id).limit(nil).order('pinned_at DESC').pluck(:id)
|
||||
|
Reference in New Issue
Block a user