FIX: allows listing messages of any thread (#27259)

Before this fix we could only list messages of a thread if it was part of a `threading_enabled` channel or if the thread was set to `force`.

Due to our design of also using a thread id when this is just a chain of replies so we can switch from threading enabled to disabled at any time, we will allow `Chat:: ListChannelThreadMessages` to list the messages of any thread, the only important requirements are:
- having a thread id
- being able to access this thread

To allow this, this commit simply removes the check on `threading_enabled` or `force`.
This commit is contained in:
Joffrey JAFFEUX
2024-05-30 10:20:40 +02:00
committed by GitHub
parent 222a5f4677
commit 5aefda1dee
5 changed files with 2 additions and 50 deletions

View File

@ -86,9 +86,6 @@ module ChatSDK
on_success { result.messages }
on_failed_policy(:can_view_thread) { raise "Guardian can't view thread" }
on_failed_policy(:target_message_exists) { raise "Target message doesn't exist" }
on_failed_policy(:ensure_thread_enabled) do
raise "Threading is not enabled for this channel"
end
on_failure { raise "Unexpected error" }
end
end