mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Exclude PMs that user sent to themselves. (#14496)
Regression from016efeadf6Follow-up to016efeadf6
This commit is contained in:
committed by
GitHub
parent
d39315239e
commit
34cebfd867
@@ -5,6 +5,15 @@ class TopicQuery
|
||||
def list_private_messages(user)
|
||||
list = private_messages_for(user, :user)
|
||||
list = not_archived(list, user)
|
||||
|
||||
list = list.where(<<~SQL)
|
||||
NOT (
|
||||
topics.participant_count = 1
|
||||
AND topics.user_id = #{user.id.to_i}
|
||||
AND topics.moderator_posts_count = 0
|
||||
)
|
||||
SQL
|
||||
|
||||
create_list(:private_messages, {}, list)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user