FIX: User archiving message should also publish to sent section.
This commit is contained in:
parent
bef35f7be5
commit
5169be6080
|
@ -252,14 +252,18 @@ SQL
|
|||
|
||||
allowed_user_ids = topic.allowed_users.pluck(:id)
|
||||
|
||||
if allowed_user_ids.include?(post&.user_id)
|
||||
if post && allowed_user_ids.include?(post.user_id)
|
||||
channels["/private-messages/sent"] = [post.user_id]
|
||||
end
|
||||
|
||||
if user_archive
|
||||
elsif user_archive
|
||||
user_ids = [user_id]
|
||||
channels["/private-messages/archive"] = user_ids
|
||||
channels["/private-messages/inbox"] = user_ids
|
||||
|
||||
[
|
||||
"/private-messages/archive",
|
||||
"/private-messages/inbox",
|
||||
"/private-messages/sent",
|
||||
].each do |channel|
|
||||
channels[channel] = user_ids
|
||||
end
|
||||
else
|
||||
topic.allowed_groups.each do |group|
|
||||
channel = "/private-messages/group/#{group.name.downcase}"
|
||||
|
|
|
@ -163,7 +163,13 @@ describe TopicTrackingState do
|
|||
)
|
||||
end
|
||||
|
||||
["/private-messages/archive", "/private-messages/inbox"].each do |channel|
|
||||
expect(messages.count).to eq(3)
|
||||
|
||||
[
|
||||
"/private-messages/archive",
|
||||
"/private-messages/inbox",
|
||||
"/private-messages/sent",
|
||||
].each do |channel|
|
||||
message = messages.find do |message|
|
||||
message.channel = channel
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue