mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +08:00
FEATURE: display PM participant group names in the topics list. (#21677)
After this change, we can view all participant group names on the topic list page. Co-authored-by: Régis Hanol <regis@hanol.fr>
This commit is contained in:
@ -71,7 +71,7 @@ class TopicQuery
|
||||
list = list.where("gm.id IS NULL")
|
||||
publish_read_state = !!group.publish_read_state
|
||||
list = append_read_state(list, group) if publish_read_state
|
||||
create_list(:private_messages, { publish_read_state: publish_read_state }, list)
|
||||
create_list(:private_messages, { publish_read_state: publish_read_state, group: group }, list)
|
||||
end
|
||||
|
||||
def list_private_messages_group_archive(user)
|
||||
@ -84,7 +84,7 @@ class TopicQuery
|
||||
|
||||
publish_read_state = !!group.publish_read_state
|
||||
list = append_read_state(list, group) if publish_read_state
|
||||
create_list(:private_messages, { publish_read_state: publish_read_state }, list)
|
||||
create_list(:private_messages, { publish_read_state: publish_read_state, group: group }, list)
|
||||
end
|
||||
|
||||
def list_private_messages_group_new(user)
|
||||
@ -92,14 +92,14 @@ class TopicQuery
|
||||
list = remove_dismissed(list, user)
|
||||
publish_read_state = !!group.publish_read_state
|
||||
list = append_read_state(list, group) if publish_read_state
|
||||
create_list(:private_messages, { publish_read_state: publish_read_state }, list)
|
||||
create_list(:private_messages, { publish_read_state: publish_read_state, group: group }, list)
|
||||
end
|
||||
|
||||
def list_private_messages_group_unread(user)
|
||||
list = filter_private_messages_unread(user, :group)
|
||||
publish_read_state = !!group.publish_read_state
|
||||
list = append_read_state(list, group) if publish_read_state
|
||||
create_list(:private_messages, { publish_read_state: publish_read_state }, list)
|
||||
create_list(:private_messages, { publish_read_state: publish_read_state, group: group }, list)
|
||||
end
|
||||
|
||||
def list_private_messages_warnings(user)
|
||||
@ -259,6 +259,7 @@ class TopicQuery
|
||||
Topic
|
||||
.private_messages
|
||||
.includes(:allowed_users)
|
||||
.includes(:allowed_groups)
|
||||
.joins(
|
||||
"LEFT OUTER JOIN topic_users AS tu ON (topics.id = tu.topic_id AND tu.user_id = #{user.id.to_i})",
|
||||
)
|
||||
|
Reference in New Issue
Block a user