mirror of
https://github.com/discourse/discourse.git
synced 2024-12-17 06:03:43 +08:00
SECURITY: Only publish PM reply messagebus notifications to allowed users
This commit is contained in:
parent
d4d548a874
commit
7cd4880e24
|
@ -147,7 +147,13 @@ class Post < ActiveRecord::Base
|
||||||
}.merge(options)
|
}.merge(options)
|
||||||
|
|
||||||
if Topic.visible_post_types.include?(post_type)
|
if Topic.visible_post_types.include?(post_type)
|
||||||
|
if topic.archetype == Archetype.private_message
|
||||||
|
user_ids = User.where('admin or moderator').pluck(:id)
|
||||||
|
user_ids |= topic.allowed_users.pluck(:id)
|
||||||
|
MessageBus.publish(channel, msg, user_ids: user_ids)
|
||||||
|
else
|
||||||
MessageBus.publish(channel, msg, group_ids: topic.secure_group_ids)
|
MessageBus.publish(channel, msg, group_ids: topic.secure_group_ids)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
user_ids = User.where('admin or moderator or id = ?', user_id).pluck(:id)
|
user_ids = User.where('admin or moderator or id = ?', user_id).pluck(:id)
|
||||||
MessageBus.publish(channel, msg, user_ids: user_ids)
|
MessageBus.publish(channel, msg, user_ids: user_ids)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user