DEV: Use service objects for chat thread lookup (#20276)

Adds a new LookupThread class that handles finding the
thread based on thread + channel ID, checking permissions
and policy/contract checks.

Co-authored-by: Loïc Guitaut <loic@discourse.org>
This commit is contained in:
Martin Brennan
2023-02-17 04:17:26 +10:00
committed by GitHub
parent 5ebf016a3f
commit 584d9a9438
7 changed files with 171 additions and 24 deletions

View File

@ -222,6 +222,7 @@ after_initialize do
load File.expand_path("../app/services/update_channel_status.rb", __FILE__)
load File.expand_path("../app/services/chat_message_destroyer.rb", __FILE__)
load File.expand_path("../app/services/update_user_last_read.rb", __FILE__)
load File.expand_path("../app/services/lookup_thread.rb", __FILE__)
load File.expand_path("../app/controllers/api_controller.rb", __FILE__)
load File.expand_path("../app/controllers/api/chat_channels_controller.rb", __FILE__)
load File.expand_path("../app/controllers/api/chat_current_user_channels_controller.rb", __FILE__)